The toxicity of plants is primarily a defense mechanism against herbivores. Toxic compounds deter animals from eating them. These compounds vary greatly among plants and can include alkaloids, glycosides, and saponins. For example, the deadly nightshade, or Atropa belladonna, contains toxic alkaloids like atropine and scopolamine, which can be lethal in small doses.