Humans in general have a thing for alcohol. Drinking alcohol has been a part of the human experience for essentially as long as there have been humans. But why do humans like alcohol so much? The answer could go all the way back to evolution and what’s known as the drunken monkey hypothesis.

The theory was originally put forth by Robert Dudley, a professor of integrative biology at the University of California, Berkeley, in a 2000 article called “Evolutionary origins of human alcoholism in primate frugivory.” The hypothesis proposes that apes and early humans evolved to seek out ethyl alcohol because it led them to food. These early primates are known as frugivores, referring to their preference for fruit over any other food. But in order to locate that desirable fruit and those crucial calories, frugivores couldn’t just hit the local Whole Foods. They had to rely on their sense of smell. And one thing that routinely led them to fruit was the smell of alcohol.

That’s because natural fermentation occurs when yeast eats sugar. Yeast floating through the air attaches itself to fallen fruit, and then eats the sugars in that fruit. A byproduct of the yeast’s consumption of sugar is alcohol — and alcohol’s smell. For frugivores, that smell meant food was near. Animals that could detect the smell of fermenting fruit had a better chance of survival because it meant more calories. Ergo, we developed a taste for alcohol because its smell kept us alive. As Dudley concludes in his article, “Although diverse factors contribute to the expression of alcoholism as a clinical syndrome, historical selection for the consumption of ethanol in the course of frugivory can be viewed as a subtle yet pervasive evolutionary influence on modern humans.”

Dudley, whose father had suffered from alcoholism, eventually accumulated all the data into a 2014 book called “The Drunken Monkey: Why We Drink and Abuse Alcohol.” “Where there is sugar in the tropics, there is alcohol,” he explained to Berkeley News. “Now, not a lot; it depends on how much you consume. They are not drinking down gin and tonics, but they are getting a long, sustained, low-level exposure.”

Though early primate ancestors may not have been drinking cocktails, Dudley arrived at his hypothesis over one. “It was in Panama, where I lived for five years,” he told Berkeley News. “It was a combination of long term exposure to the foraging biology of monkeys in the field, and the nicest experience in the world, which is sitting on the veranda at 5:30 p.m. with a Rum and Coke in hand, watching the sun go down.”

It was on the veranda, cocktail in hand, that he came up with the theory. “I remember thinking once, ‘What is it about humans and alcohol, and this triangle of monkeys, fruit and alcohol fermentation? Maybe it is just an ancestral association of fruit-eating with alcohol production by yeast.’ Then, my immediate next thought, which I remember even more clearly, was that this is a real simple and obvious idea.”

Today, humans forage for alcohol in stores, not the wild. But at its most basic, is hunting for a bottle of wine really all that different from hunting for wildly fermenting fruit and sap? The next time you’re browsing the bottles, take a second to consider the long evolutionary tradition of searching for the perfect beverage.