This is an edited excerpt from “I Contain Multitudes: The Microbes Within Us and a Grander View of Life,” which will be published on August 9th by Ecco, an imprint of HarperCollins Publishers.

The Foods for Health Institute, at the University of California, Davis, has the appearance of a Tuscan villa, its terra-cotta-walled buildings overlooking a large vineyard and a garden that bursts with summer vegetables. It is led by a chemist named Bruce German, and if there were a world title in extolling the virtues of milk he would surely hold it. At our first meeting, he spent half an hour monologuing on the subject, bouncing on an exercise ball and kneading a tattered shred of bubble wrap as he spoke. Milk, he said, is a perfect source of nutrition, a superfood that is actually worthy of the label. This isn’t a common view. The number of scientific publications about milk is tiny, compared with the number devoted to other bodily fluids—blood, saliva, even urine. The dairy industry has spent a fortune on extracting more and more milk from cows, but very little on understanding just what this white liquid is or how it works. Medical-funding agencies have generally dismissed it as irrelevant, German said, because “it doesn’t have anything to do with the diseases of middle-aged white men.” And nutritionists have looked at it as a simple cocktail of fats and sugars, one that can be easily duplicated and replaced by formulas. “People said it’s just a bag of chemicals,” German told me. “It’s anything but that.”

Milk is a mammalian innovation, common to platypuses and pangolins, humans and hippos, its ingredients varying according to what each species needs. Human milk is a particular marvel. Every mammal mother produces complex sugars called oligosaccharides, but human moth­ers, for some reason, churn out an exceptional variety: so far, scientists have identified more than two hundred human milk oligosaccharides, or H.M.O.s. They are the third-most plentiful ingredient in human milk, after lactose and fats, and their structure ought to make them a rich source of energy for growing babies—but babies cannot digest them. When German first learned this, he was gobsmacked. Why would a mother expend so much energy manufacturing these complicated chemicals if they were apparently useless to her child? Why hasn’t natural selection put its foot down on such a wasteful practice? Here’s a clue: H.M.O.s pass through the stom­ach and the small intestine unharmed, landing in the large intestine, where most of our bacteria live. What if they aren’t food for babies at all? What if they are food for microbes?

This idea dates back to the early twentieth century, when two very different groups of scientists made discoveries that, unbeknownst to them, were closely connected. In one camp, pediatricians found that microbes called Bifidobacteria (“Bifs,” to their friends) were more com­mon in the stools of breast-fed infants than bottle-fed ones. They argued that human milk must contain some substance that nourished the bacteria—something that later scientists called the bifidus factor. Meanwhile, chemists had discovered that human milk contains carbo­hydrates that cow milk does not, and were gradually whittling this enig­matic mixture down to its individual components, including several oligosaccharides. The parallel tracks met in 1954, thanks to a partner­ship between Richard Kuhn (chemist, Austrian, Nobel laureate) and Paul Gyorgy (pediatrician, Hungarian-born American, breast-milk advocate). Together they confirmed that the mysterious bifidus factor and the milk oligosaccharides were one and the same—and that they nourished gut microbes.

By the nineteen-nineties, scientists knew that there were more than a hundred H.M.O.s in milk, but they had characterized only a few. No one knew what most of them looked like or which species of bacteria they fed. The common wisdom was that they nourished all Bifs equally, but German wasn’t satis­fied. He wanted to know exactly who the diners were and what dishes they were ordering. To do that, he took a cue from history and assem­bled a diverse team of chemists, microbiologists, and food scientists. Together they identified all the H.M.O.s, pulled them out of the milk, and fed them to bacteria. And, to the researchers’ chagrin, nothing grew.

The problem soon became clear: H.M.O.s are not an all-purpose food for Bifs. In 2006, the team found that the sugars selectively nourish one subspecies, Bifidobacterium longum infantis. As long as you provide B. infantis with H.M.O.s, it will outcompete any other gut bacterium. A closely related subspe­cies, B. longum longum, grows weakly on the same sugars, and the ironi­cally named B. lactis, a common fixture of probiotic yogurts, doesn’t grow at all. Another probiotic mainstay, B. bifidum, does slightly better, but is a fussy, messy eater. It breaks down a few H.M.O.s and takes in the pieces it likes. By contrast, B. infantis devours every last crumb using a cluster of thirty genes—a comprehensive cutlery set for eating H.M.O.s. No other Bif has this genetic cluster; it is unique to B. infantis. Human milk has evolved to nourish the microbe, and it, in turn, has evolved into a consummate H.M.O.vore. Unsurprisingly, it is often the dominant microbe in the guts of breast-fed infants.

B. infantis earns its keep. As it digests H.M.O.s, it releases short-chain fatty acids, which feed an infant’s gut cells. Through direct contact, B. infantis also encourages gut cells to make adhesive proteins that seal the gaps between them, keeping microbes out of the bloodstream, and anti-inflam­matory molecules that calibrate the immune system. These changes only happen when B. infantis feeds on H.M.O.s; if it gets lactose instead, it survives but doesn’t engage in any repartee with the baby’s cells. In other words, the microbe’s full beneficial potential is unlocked only when it feeds on breast milk. Likewise, for a child to reap the full benefits that milk can provide, she must have B. infantis in her gut. For that reason, David Mills, a microbiolo­gist who works with German, actually sees B. infantis as part of milk, albeit a part that is not made in the breast.

It is unclear why human breast milk stands out among that of other mammals. It has five times as many types of H.M.O.s as cow’s milk, and several hun­dred times the quantity. Even chimp milk is impoverished compared with ours. Mills suggests a couple of possible explanations for this difference. One involves our brains, which are famously large for a primate of our size, and which grow incredibly quickly during our first year of life. This fast growth partly depends on a nutrient called sialic acid, which also happens to be one of the chemicals that B. infantis releases while it eats H.M.O.s. It is possible that, by keeping this bacte­rium well fed, mothers can raise brainier babies. This might explain why, among monkeys and apes, social species have more milk oligo­saccharides than solitary ones, and a greater range of them to boot. Living in larger groups requires remembering more social ties, managing more friendships, and manipulating more rivals. Many scientists believe that these demands drove the evolution of primate intelligence; perhaps they also fuelled the diversity of H.M.O.s.

An alternative idea involves diseases. In a group setting, pathogens can easily bounce from one host to another, so animals need better ways of pro­tecting themselves. H.M.O.s provide one such defense. When a pathogen infects our guts, it almost always begins by latching onto glycans—sugar molecules—on the surfaces of our intestinal cells. But H.M.O.s bear a striking resemblance to these glycans, so pathogens sometimes stick to them instead. They act as decoys, drawing fire away from a baby’s own cells. They can block a roll call of gut villains, including Salmonella; Listeria; Vibrio cholerae, the culprit behind cholera; Campylobacter jejuni, the most common cause of bacterial diarrhea; Entamoeba histolytica, a vora­cious amoeba that causes dysentery and kills a hundred thousand people every year; and many virulent strains of E. coli. H.M.O.s may even be able to obstruct H.I.V., which might explain why more than half of infants who suckle from infected mothers don’t get infected, despite drinking virus-loaded milk for months. Every time scientists have pitted a pathogen against cultured cells in the presence of H.M.O.s, the cells have come out smil­ing.