Plants have been developing adaptations against herbivory as long as herbivores have existed, since 420 million years ago (in the late Silurian) or even earlier. The earliest fossils of land plants date to between 510 and 450 million years ago, during the late Cambrian and Ordovician periods. The earliest fossils of herbivores (millipedes) date to 428 million years ago, during the mid-Silurian, so there may have been a period during which plants could exist without evolving adaptations against herbivory by animals, though they were probably preyed on by fungi, bacteria, archaea, and microorganisms during this time.
Modern plant adaptations against herbivory fall into four main categories: avoiding or repelling the herbivores (antixenosis), tolerating herbivory and regenerating quickly or leading the herbivore to devour non-essential parts, summoning the natural enemies of the herbivores in question, or direct confrontation; producing toxins to kill the herbivore or reduce its own digestability (antibiosis). As insects have been the most important herbivores throughout evolutionary history, most plant defenses are against them, though some plant adaptations against herbivory focus on vertebrate herbivores like birds or mammals.
Consider three obvious examples of plant adaptations to herbivory. There is poison ivy, which produces the oil urushiol, which causes contact dermatitis in many animals, including humans. One brush with poison ivy and hours of itching later, the plant is likely to be left alone. Another of the plant adaptations against herbivory is demonstrated by the beautiful purple foxgloves, which produce numerous deadly chemicals. Even a tiny nibble of the stems at the top of a foxglove is enough to cause nausea, vomiting, wild hallucinations, diarrhea, abdominal pain, delirium, severe headache, and death. A more mild example of the plant adaptations against herbivory is demonstrated by roses, which are protected against herbivores by thorns.
Some plants produce chemicals intended to defend themselves against herbivores that are largely harmless to humans, but cause interesting psychoactive effects. This includes marijuana, which has been smoked by humans since prehistoric times, caffeine, which is consumed daily by 90% of adults in North America, and opium, which is used to produce morphine, an important painkiller.