Scientists have analyzed coffee's DNA, and found that it evolved its known caffeine kick to better plants, according to a new study.

"It's an accident that has been frozen in place very likely by the influence of natural selection," evolutionary biologist Victor Albert, of the University of Buffalo, told The Associated Press.

Albert and more than 60 other researchers from around the world mapped out the genome of robusta coffee, a plant variety that accounts for about one-third of the world's consumption. They found that coffee evolved to pack a caffeine punch, which actually turned out to be good for the plant.

There are several theories as to why a plant would want to give its leaves an energy buzz. For instance, it might prevent bugs from munching on plant leaves, make surrounding soil less hospitable to rival seedlings, or attract potential pollinators that may be caffeine addicts.

"So pollinators come back for more - just like we do for our cups of coffee," Albert said.

Whatever the root cause, plants such as tea, coffee and chocolate developed enzymes to make caffeine, though they developed the enzyme separately. Researchers found that the enzymes used to make caffeine in coffee and chocolate, for instance, aren't closely related enough to share a common ancestor. Meaning, the two plants became caffeinated independently of each other.

Scientists have yet to develop a genome for tea, The Washington Post reports, so they do not know if it, too, developed caffeine on its own.

Not only do these findings, published in the journal Science, reveal more about the evolution of caffeine, but they may also be helpful in further plant genome sequencing.

"When we compared the coffee to several other species, we saw a huge enrichment in disease-resistant genes," Albert told The Post. "Those can now be rapidly explored in more detail, and could be of use in both coffee breeding and in the molecular modification of coffee."