First the ancestral plant must have adapted to move its tentacles and leaves in a particular direction, giving it a greater chance of sticking to and engulfing a passing insect.
Next it sped up how quickly it detected prey and tried to respond.
Then the plant would have had to find a way to become selective, so it only tried to trap live prey and not any detritus that landed upon it.
Finally, it must have evolved its tentacles into sensory hairs and teeth that detect and wrap around prey, respectively, while also losing its sticky glands and growing new digestive glands capable of digesting the victim's corpse.
The adaptations led to the plant's ability to eat larger insects for more nutrition. Link -via the Presurfer