Alkaloids produced by plants that are found both in nectar and pollen serve as protection against herbivores. A research study led by the University of Exeter and Bayer AG showed how genes of several species of pollinators called Hymenoptera - insects that include bees, wasps, ants, and sawflies - produce enzymes that detoxify the defense chemicals released by plants.
All species, though they vary greatly, produced the same enzymes known as the CYP336 which fights against alkaloid toxins. This group of genes underwent a long evolutionary history consisting of a complete order of insects that had distinct and diverse lifestyles. Even though some species had very little contact with certain key alkaloids, it appears that they still retained the ability to metabolize them. This is evidence of genetic heritage.