Almost everyone needs a good cup of joe in the morning to get them going, and, according to legend, it’s all because of a 9th-century Ethiopian goat-herder named Kaldi.

Allegedly, Kaldi observed his goats behaving erratically after eating the red berries from a nearby Coffea arabica tree. He tried some of them himself and was soon acting as hyper as his herd. He then brought a batch to a monastery where they were derided for their stimulating effects during long hours of prayer. The religious leaders there threw the tree’s beans onto a fire to destroy them, but the pleasing aroma of the roasted beans convinced them to give the coffee a second chance. Much like with tea, they put the roasted beans into warm water and the beverage was born.

Despite the legend, it’s thought that the practice of chewing coffee beans as a stimulant was around for centuries before Kaldi's alleged discovery. People would grind the beans to mix with butter and animal fat to preserve and eat on long journeys. Similarly, Sudanese slaves are thought to have chewed on coffee beans to help them survive their difficult voyages on trade routes.

The cultivation and trade of the beans for the drink began in Arabic countries in the 14th century and spread throughout Egypt, Syria, and Turkey. It's said not a single coffee plant existed outside of Arabia or Africa until the 1600s, when a pilgrim named Baba Budan brought them back to India. In 1616, Pieter van der Broeck smuggled some coffee out of Mocha, Yemen and brought it back to Amsterdam. Soon, the Dutch and their colonies—most notably Sri Lanka and Java—took over the European trade, followed by the French in the Caribbean, the Spanish in Central America, and the Portuguese in Brazil. The drink eventually made its way to America via British colonizers who docked in New York City.

Today, coffee is a 100 billion dollar a year industry, supporting 25 million people worldwide. How did we ever survive mornings without it?