Nature has a way of taking care of itself. Natural defenses are built up over time by living organisms to protect themselves from danger. Animals develop horns, sharp teeth, thick coats of fur and various other defenses. Plants are no different.
Today we will discuss chemical defenses used by plants to ward off destruction by insects. It may surprise you to know that these substances have been co-opted by humans for other uses.
The chemical caffeine is found in these plant parts: cocoa beans, kola nuts, tea leaves and coffee beans. Other natural sources of caffeine include yerba maté, guarana berries, guayusa, and the yaupon holly. As you are well aware humans use this chemical as a stimulant on a daily basis. Plants use caffeine as a natural pest repellent so that they are not devoured by insects.
Another chemical which you are well aware of, nicotine, is also a stimulant people have ingested for many thousands of years. Tobacco plants use the chemical to protect themselves from destruction. Even a small dose of nicotine is deadly to tiny insects. Natives would place tobacco leaves around their living spaces to keep them pest-free.
Unfortunately, this chemical is abused by humans recreationally to great harm but its derivatives are still being used today positively as local painkillers for surgeries and dentistry. Lidocaine & Novocaine were directly developed from the cocaine chemical. The reason why your heart rate increases when you are at the dentist is not solely due to natural nervousness. The coca plant protects itself from hungry creatures of all types by interrupting their neurotransmitters.
Again, this is a substance which has helped mankind when used responsibly throughout the ages. It is the best natural painkiller known to man. It is unfortunate that it has been abused by people. The opium poppy protects itself by emitting an alkaloid called morphine. It is believed this is a natural pest repellant to keep the poppy plant from being devoured by pests.
All of the chemicals mentioned above can be used for good or bad. Plants use them for nothing but good and it is arguable that they have done much more good than harm when used by humans in a responsible way.