Dairy milk has competition. Alternative “milks” made from plants like soya or almonds are increasingly popular. These alternatives are often vegan-friendly and can be suitable for people who are allergic to milk, or intolerant of it. The runner-up in the 2018 series of The Apprentice (UK) ran a flavoured nut milk business.

But the rise of alternative milks is just the latest twist in the saga of humanity’s relationship with animal milk. This relationship dates back thousands of years, and it has had a lot of ups and downs.

When you think about it, milk is a weird thing to drink. It’s a liquid made by a cow or other animal to feed its young; we have to squirt it out of the cow’s udders to obtain it.

You might also like:
We don’t need nearly as much protein as we consume
What would happen if the world went vegetarian?
Should you avoid dairy when you have a cold?

In many cultures it is almost unheard of. Back in 2000, China launched a nationwide campaign to encourage people to consume more milk and dairy products for health reasons – a campaign that had to overcome the deep suspicions of many older Chinese people. Cheese, which is essentially milk that has been allowed to go off, can still make many Chinese people feel sick.

Set against the 300,000-year history of our species, drinking milk is quite a new habit. Before about 10,000 years ago or so, hardly anybody drank milk, and then only on rare occasions. The first people to drink milk regularly were early farmers and pastoralists in western Europe – some of the first humans to live with domesticated animals, including cows. Today, drinking milk is common practice in northern Europe, North America, and a patchwork of other places.

Baby food

There is a biological reason why drinking animal milk is odd.

Milk contains a type of sugar called lactose, which is distinct from the sugars found in fruit and other sweet foods. When we are babies, our bodies make a special enzyme called lactase that allows us to digest the lactose in our mother’s milk. But after we are weaned in early childhood, for many people this stops. Without lactase, we cannot properly digest the lactose in milk. As a result, if an adult drinks a lot of milk they may experience flatulence, painful cramps and even diarrhoea. (It’s worth noting that in other mammals, there aren’t any lactase-persistent adults – adult cows don’t have active lactase, and neither do cats or dogs, for example).

So the first Europeans who drank milk probably farted a lot as a result. But then evolution kicked in: some people began to keep their lactase enzymes active into adulthood. This “lactase persistence” allowed them to drink milk without side effects. It is the result of mutations in a section of DNA that controls the activity of the lactase gene.

“The first time that we see the lactase persistence allele in Europe arising is around 5,000 years BP [before present] in southern Europe, and then it starts to kick in in central Europe around 3,000 years ago,” says assistant professor Laure Ségurel at the Museum of Humankind in Paris, who co-authored a 2017 review of the science of lactase persistence.

The lactase persistence trait was favoured by evolution and today it is extremely common in some populations. In northern Europe, more than 90% of people are lactase persistent. The same is true in a few populations in Africa and the Middle East.

But there are also many populations where lactase persistence is much rarer: many Africans do not have the trait and it is uncommon in Asia and South America.

It is hard to make sense of this pattern because we don’t know precisely why drinking milk, and therefore lactase persistence, was a good thing, says Ségurel: “Why was it so strongly advantageous in itself?”

The obvious answer is that drinking milk gave people a new source of nutrients, reducing the risk of starvation. But on closer inspection this doesn’t hold up.

“There’s a lot of different sources of food, so it’s surprising that one source of food is so important, so different from other sorts of food,” says Ségurel.

People who are lactase-non-persistent can still eat a certain amount of lactose without ill effects, so drinking a small amount of milk is fine. There is also the option of processing milk into butter, yoghurt, cream or cheese – all of which reduce the amount of lactose. Hard cheeses like cheddar have less than 10% as much lactose as milk, and butter is similarly low. (Read more about parmigiano, a cheese with so little lactose it can be eaten by the lactose-intolerant). “Heavy cream and butter have the lowest lactose,” says Ségurel.

Accordingly, people seem to have invented cheese rather quickly. In September 2018, archaeologists reporting finding fragments of pottery in what is now Croatia. They carried fatty acids, suggesting that the pottery had been used to separate curds from whey: a crucial step in making cheese. If that is correct (and the interpretation has been questioned), people were making cheese in southern Europe 7,200 years ago. Similar evidence from slightly more recent times, but still more than 6,000 years ago, has been found elsewhere in Europe. This is well before lactase persistence became common in Europeans.

That said, there is clearly a pattern behind which populations evolved high levels of lactase persistence and which didn’t, says genetics professor Dallas Swallow of University College London. Those with the trait are pastoralists: people who raise livestock. Hunter-gatherers, who do not keep animals, did not acquire the mutations. Neither did “forest gardeners” who cultivated plants, but not livestock.

It makes sense that people who did not have access to animal milk were not under great evolutionary pressure to adapt to drinking it.

The question is, why did some pastoralist people acquire the trait and not others?

Ségurel points to east Asian herding peoples, such as those in Mongolia, who have some of the lowest rates of lactase persistence even though they rely heavily on milk from their animals for food. The mutations were common in nearby populations in Europe and western Asia, so it would have been possible for them to spread into these east Asian groups, but they didn’t. “That’s the big puzzle,” says Ségurel.

Dairy benefits

Drinking milk might have other advantages besides its nutritional value

She speculates that drinking milk might have other advantages besides its nutritional value. People who keep livestock are exposed to their diseases, which can include anthrax and cryptosporidiosis. It may be that drinking cow’s milk provides antibodies against some of these infections. Indeed, milk's protective effect is thought to be one of the benefits of breastfeeding children.

But some of the mysterious absences of lactase-persistence could be down to sheer chance: whether anyone in a group of pastoralists happened to get the right mutation. Until fairly recently there were a lot fewer people on Earth and local populations were smaller, so some groups would miss out by plain bad luck.

“I think the most coherent part of the picture is that there’s a correlation with the way of life, with pastoralism,” says Swallow. “But you have to have the mutation first.” Only then could natural selection go to work.

In the case of Mongolian herders, Swallow points out that they typically drink fermented milk, which again has a lower lactose content. Arguably, the ease with which milk can be processed to be more edible makes the rise of lactase persistence even more puzzling. “Because we were so good at adapting culturally to processing and fermenting the milk, I’m struggling with why we ever adapted genetically,” says Swallow’s PhD student Catherine Walker.

There may have been several factors promoting lactase persistence, not just one. Swallow suspects that the key may have been milk’s nutritional benefits, such as that it is rich in fat, protein, sugar and micronutrients like calcium and vitamin D.

It is also a source of clean water. Depending on where your community lived, you may have evolved to tolerate it for one reason over another.

It’s unclear whether lactase persistence is still being actively favoured by evolution, and thus whether it will become more widespread, says Swallow. In 2018 she co-authored a study of a group of pastoralists in the Coquimbo region of Chile, who acquired the lactase-persistence mutation when their ancestors interbred with newly-arrived Europeans 500 years ago. The trait is now spreading through the population: it is being favoured by evolution, as it was in northern Europeans 5,000 years ago.

But this is a special case because the Coquimbo people are heavily reliant on milk. Globally, the picture is very different. “I would think it’s stabilised myself, except in countries where they have milk dependence and there is a shortage [of other food],” says Swallow. “In the West, where we have such good diets, the selective pressures are not really likely to be there.”

Dairy decline?

If anything, the news over the last few years offers the opposite impression: that people are abandoning milk. In November 2018, the Guardian published a story headlined “How we fell out of love with milk”, describing the meteoric rise of the companies selling oat and nut milks, and suggesting that traditional milk is facing a major battle.

But the statistics tell a different story. According to the 2018 report of the IFCN Dairy Research Network, global milk production has increased every year since 1998 in response to growing demand. In 2017, 864 million tonnes of milk were produced worldwide. This shows no sign of slowing down: the IFCN expects milk demand to rise 35% by 2030 to 1,168 million tonnes. (Read more about how milk became a staple food in industrialised societies).

Still, this masks some more localised trends. A 2010 study of food consumption found that in the US milk consumption has fallen over the last few decades – although it was replaced with fizzy drinks, not almond milk. This fall was balanced by growing demand in developing countries, especially in Asia – something the IFCN has also noted. Meanwhile, a 2015 study of people’s drinking habits in 187 countries found that milk drinking was more common in older people, which does suggest that it is less popular with the young – although this says nothing about young people’s consumption of milk products like yoghurt.

Still, it seems unlikely that alternative milks will make much of a dent in the world’s growing appetite for milk, at least over the next decade.

Walker adds that alternative milks are “not a like-for-like substitution” for animal milk. In particular, many don’t have the same micronutrients. She says they are most useful for vegans and for people allergic to milk – the latter being a reaction to milk protein, and nothing to do with lactose.

It’s particularly striking that so much of the growth in milk demand is in Asia, where most people are non-lactase-persistent. Whatever advantages the people there see in milk, they outweigh the potential digestive issues or the need to process the milk.

In fact, the United Nations Food and Agriculture Organisation has pushed for people in developing countries to keep more non-traditional dairy animals, such as llamas, so that they can obtain the benefits of milk even if cow’s milk is unavailable or too expensive.

What’s more, a major study published in January described a “planetary health diet” that is designed to both maximise health and minimise our impact on the environment. While it entails drastically cutting down on red meat and other animal products, it nevertheless includes the equivalent of one glass of milk a day.

Milk, it seems, is not down and out. If anything it’s still on the up – even if our bodies have mostly stopped evolving in response to it.

Join 900,000+ Future fans by liking us on Facebook, or follow us on Twitter or Instagram.

If you liked this story, sign up for the weekly bbc.com features newsletter, called “If You Only Read 6 Things This Week”. A handpicked selection of stories from BBC Future, Culture, Capital, and Travel, delivered to your inbox every Friday.