Every mammal produces milk to rear its young. What’s in that milk depends on everything from the heat of the climate to how long the baby needs to feed for. And human milk, it turns out, has much in common with one of Africa’s wildest species.

Nine out of every 10 glasses of raw milk produced in the world come from domestic cattle. The remaining one is sourced primarily from goats, buffaloes, sheep, and camels. Less commonly, humans consume the milk of a menagerie of domesticated and semi-domesticated ungulates, such as alpaca, elk, llama, moose, musk ox, and yak.

Altogether, global dairy operations produce some 700 million tons of milk each year. But there is, of course, one more species missing from this list of milk providers: our own. 

According to the CDC, more than three-quarters of American parents provided at least some breast milk to their infants in 2013. While there are many benefits to breastfeeding, one of its primary functions is to provide nutrition to a growing infant. But what’s actually in human milk, from a nutritional perspective? How similar is human milk to milk produced by domestic cows? And what other animals might have milk closer in make-up to our own? Fortunately, the scientific literature is awash in milk research.

All mammals are capable of producing milk, from the egg-laying monotremes like platypuses, to pouch-sporting marsupials like kangaroos and wallabies, and the more reproductively familiar rabbits, tigers, hippos, monkeys, and dolphins. But because different species have different needs and live in different environments, it turns out their milks are very different as well. They have mostly similar ingredients, but in different proportions.

Hooded seals, for example, live in the frigid coastal waters of the North Atlantic. After a mother seal gives birth, her offspring need to build up a layer of warm blubber very quickly if they are to survive in such harsh conditions while learning to swim and hunt. That explains when their milk contains about 61% fat, and just 5% protein and 1% milk sugars. Since the seals give birth on unstable ice sheets to avoid the risk of predation by polar bears, they have a very short window in which to give birth and nurse. Over the course of just four days, hooded seal moms must transfer up to seven kilograms of milk fat to their pups each day.

Human infants require a very long period of parental care following birth

By contrast, terrestrial grazers are generally free of the need to transfer as much energy to their infants as possible in a brief period of time. Instead, these mothers nurse their infants over many weeks or months, delivering an overall similar amount of nutrition in smaller doses. They offer on-demand milk service to their youngster. Perhaps that explains why black rhinos’ milk contains just 0.2% fat, or why around 1.5% of gorilla milk is comprised of fat.

Human milk lies somewhere between these two extremes, and as with all species, reflects a trade-off between the mother’s own nutritive requirements and those of her offspring, situated within the evolutionary context in which our species evolved.

Human infants require a very long period of parental care following birth. That allows their mothers to produce more watery, diluted milk. If their milk were too energy-dense, like hooded seal milk, our mothers would not have enough energy left to chase their kids around. So human milk contains just 4% fat, 1.3% protein, and 7.2% lactose. Around 90% of the stuff is just water.

As anthropologists Katie Hinde and Lauren Milligan explain, it turns out that plains zebra produce very similar milk, with 2.2% fat, 1.6% protein, 7% lactose, and 89% water. Human and zebra milk are both characterized by high water content and low energy density, with more of that energy coming from lactose than from fat. And yet Homo sapiens is separated from zebras by some 95 million years of evolution.

Mammals that eat meat, like tigers, have more fat and protein in their milk compared with mammals that eat mostly leaves

Evolution likely endowed humans with dilute milk because of the extremely slow rate of our infant development. Zebras, on the other hand, evolved in very dry, arid environment. By providing more water to their offspring, zebra mothers help their infants take advantage of evaporative cooling by sweating. Our milk may be nutritionally similar, but it evolved thanks to a very different set of survival challenges.

To more comprehensively understand the evolution of milk, Auburn University biologist Amy L Skibiel rounded up milk composition data from 130 different kinds of mammals.

She discovered that closely related species were more likely to have similar milk than more distantly related species, despite the occasional human-zebra similarity. Following phylogeny, the next best predictor for milk composition was the amount of time a species spends breastfeeding. Hooded seals nurse for just four days, meaning they need energy-dense milk, while bottlenose dolphins nurse over the course of 18 months. Following that was diet: mammals that eat meat, like tigers, have more fat and protein in their milk compared with mammals that eat mostly leaves, like giraffes or gazelles.

 

That’s not to say, of course, that the high water content of zebra milk doesn’t reflect the arid conditions in which they evolved, just that the pattern needs to be understood within the broader landscape of mammalian evolution. Indeed, since milk is common to all mammals, it likely emerged a whopping 160 million years ago. Despite its importance for providing newborn mammals with nutrition, the Hinde and Milligan point out that the two competing theories for its initial function have nothing to do with nutrition at all.

According to one hypothesis, milk first emerged as means of boosting infants’ immune systems. Antibodies passed between the two might allow infants protection from pathogens to which their mothers were exposed – pathogens that could still pose a threat. The other hypothesis is that milk initially evolved as an egg wash, a substance used to keep permeable eggs with their parchment-like shells moist. Newly hatched duck-billed platypuses do drink their mothers’ milk as well, but rather than suckling at nipples, they lick it away from modified sweat glands.

Whether it initially evolved for nutrition, immunity, or moisture, you can thank an egg-laying proto-mammal that lived some 160 million years ago called a synapsid for the milk that helped you grow big and strong. Oh, and all that butter, yoghurt, cheese, and ice cream you might have enjoyed along the way.

Join 600,000+ Future fans by liking us on Facebook, or follow us on Twitter, Google+, LinkedIn and 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, Earth, Culture, Capital, Travel and Autos, delivered to your inbox every Friday.