Adaptive Predatory Cycle
A primary driver of adaptation comes from avoiding being eaten, and, conversely, getting enough to eat. Predator and prey competitively cycle through evolutionary time.
Plants are proficient in concocting metabolites for all sorts of purposes. Many of these metabolites are chemical concoctions that make them distasteful to potential predators, or otherwise inhibit their consumption.
Herbivores adapt to ingest poisonous plants. Some then adopt the toxin for their own protection. That poison may be passed on to predators who adapt to tolerate the toxin.