It’s strange that caffeine is beneficial to us, because it apparently was developed by plants as an insecticide. The same is probably true of other plant compounds which seem to be good for people, like cinnamon, mustard, horseradish, essential oils in mints, etc. Some of these are effective against other enemies of plants like fungi, bacteria, nematodes, etc.
That is interesting.