When predatory insects lay eggs on a plant, the plant will change its scent and structure to attract other bugs that eat those eggs. They will also preemptively emit scents that ward off known pests.
A research team focused on the parasites of the cabbage plant and discovered that cabbage can very specifically alter its scent and structure in order to selectively attract certain insects. If a butterfly lays eggs on the cabbage plant, the plant may emit a scent that attracts wasps which like to feed on the eggs. This is all done well before the hungry caterpillars hatch.
Although it is strange, plants are just as alive and conscious as any other form of life.
For a vast amount of evidence and information regarding plants and consciousness I highly recommend reading The Secret Life of Plants. It documents a wide range of research in the field of biology on plants that you have probably never even heard of.