Antifeedant

Antifeedants are organic compounds produced by plants to inhibit attack by insects and grazing animals. These chemical compounds are typically classified as secondary metabolites in that they are not essential for the metabolism of the plant, but instead confer longevity. Antifeedants exhibit a wide range of activities and chemical structures as biopesticides. Examples include rosin, which inhibits attack on trees, and many alkaloids, which are highly toxic to specific insect species. 
History.
"Plant-derived insecticides (e.g., rotenone, veratridines, pyrethrins, and nicotine) have been used for insect control since antiquity." The active ingredients in these plants have been purified and modified. For example, variations on pyrethrin has spawned a large number of synthetic insecticides call pyrethroids.
Culinary implications.
In addition to their role defending the plant, antifeedants often confer taste or odors, enhancing the flavor of certain plants. Examples are provided by cruciferous vegetables including mustard, cabbage, and horseradish, which release pungent oils containing glucosinolates when the plant material is chewed, cut, or otherwise damaged. The odorous components of garlic are thought to have evolved to deter insects.