Dear student,
Insects such as flies are attracted to the cavity formed by the cupped leaf, often by visual attractions such as anthocyanin pigments, and nectar bribes of the pitcher plant. The rim of the pitcher plant is slippery, when moistened by condensation or nectar, which causes the insects to fall into the trap. Pitcher plants may also contain waxy scales,cuticular folds, inward and downward pointing hairs, etc on the inside of the pitcher or may be grooved in such a way to ensure that insects cannot climb out. And once the insect falls inside, its body gets absorbed in the liquid present inside the pitcher plant and it gets digested slowly.
Regards.