The coffee plant makes caffeine using different genes from those found in tea and cacao, suggesting that the ability to produce the stimulant evolved at least twice in plants.

Victor Albert at the University of Buffalo in New York and his colleagues sequenced the genome of robusta coffee, Coffea canephora, which makes up about one-third of all coffee produced. They found that of the genes that are unique to this plant, most are involved in caffeine production.

The stimulant probably evolved in the ancestor of coffee plants and separately in a common ancestor of tea and cacao, perhaps to defend the plants against predators and to attract pollinators.

Science 345, 1181–1184 (2014)