Plants avoid being eaten
Not all animals go to flowers to feed on their nectar; on the contrary some do so to eat them. Some plants have “developed” defences against such attacks through evolution. In some plants there are various chemicals that discourage animals to consume them.
Some ferns, for example, contain, something that is called phytoecdysones (phyto = plant and ecdysone = the growth hormone of insects). When a caterpillar indulges in a delicious leaf, it imbibes phytoecdysones that speed up the caterpillar’s development and make it reach the chrysalis stage before it is ready. Therefore it becomes malformed and never turns into a sexually mature insect.
Other plants contain substances that decompose when the plant tissue is damaged and a puff of hydrogen cyanide meets the intruder like war gas in a battle. The released dosage can be sufficient to kill a caterpillar or anything else of the same size. Other methods are that the plant produces substances that ruin the taste or reduce its nutritional value. In the first case, herbivores prefer to eat something else and the plant survives. In the second case they eat it but suffer from lack of nutrition. This means that the herbivores are reduced in number by starvation and, in the long term, will suffer from an evolutionary lower fitness.