Cesarean sections and breast feeding can have lifelong effects on a baby’s health, and researchers may have uncovered why.

It’s all about the bugs. Or, to be more precise, the bacteria that live in the gut to help digest food and, it turns out, perform a host of other important functions.

In a study published in the Canadian Medical Association Journal, researchers led by Anita Kozyrskyj found that babies born by C-section harbored a different set of microbes in their digestive tracts than those born vaginally, and that infants who were breast-fed had a different recipe of bacteria in their guts than those who were given formula.

“Our goal is to show that some decision about elective C-sections may cause changes that parents can’t see but nevertheless affect development,” says Kozyrskyj.

The findings add to the growing number of studies that expose more of the hidden universe of these microbes and the role they may play in the risk of conditions ranging from asthma to autism, obesity and cancer. The researchers studied 24 babies and compared the bacteria found in stool samples collected when the infants were 3 months old.

Previous studies have linked cesarean delivery to a higher risk of asthma, diabetes and obesity, but the reason wasn’t clear. Now, Kozyrskyj and her colleagues, led by Meghan Azad, suggest that at least part of that heightened risk may be due to the microbes colonizing the babies’ guts.

During vaginal delivery, for example, babies are baptized to the world of bacteria, viruses and other pathogens as they pass through the birth canal; birth is, in a sense, their first immunization against the bugs they are likely to encounter in their new environment as their still developing immune systems get to work taking stock of the microbes. Babies pick up the microbial content of their mother’s gut. Over time, the babies’ immune systems start to distinguish between friend and foe in the microbial world, and launch attacks on potentially harmful bugs while leaving beneficial ones, like those that live in the gut, alone.

Cesarean section, however, bypasses this immunizing opportunity, and may leave newborns more vulnerable to certain infections since their immune systems are still catching up. In the study, infants born by C-section had fewer colonies of Escherichia and Shigella bacteria than those born vaginally. These are the seeding species, says Kozyrskyj, and lay the foundation for the next groups of microbes to come. They are critical for priming the newborn’s immune system to learn which agents are potentially dangerous and which, particularly those on foods, can be given a pass. “We are still learning about this, but it seems that there is an order [to the colonization],” she says. “And if there is an order, then timing is important.”

Breast feeding also resulted in a change in microbes, with formula-fed babies showing more Peptostreptococcaceae bacteria and Clostridium difficile. In adults, C. difficile infection is associated with diarrhea and unpleasant side effects, and while babies don’t seem to be as affected by the bacteria, the presence of C. difficile could push out the Escherichia and Shigella that are so critical to developing a strong and healthy immune system.

Whether these differences translate into varied risk for disease isn’t clear yet; the study only documented the different combinations of microbes found in each group of infants. But Kozyrskyj says she plans to connect these changes to childhood conditions to find any possible associations between certain microbial communities and conditions such as allergy or asthma. “The next step is to link these changes to childhood conditions and assess whether these children have different risks for diseases, how severe their conditions are and what the patterns of these diseases are,” she says. As more studies hint that the richness and diversity of the microbial community can be an important indicator of a newborn’s health, taking stock of what’s in the diaper may actually make sense.