Once in a while, fad diets hit on something real. Take fiber, for example. The bran-muffin craze of the 1980s may have passed, but experts still agree that eating high-fiber foods is important for the digestive system. A new study published in the journal Science explains why that might be the case—and like so many things in the gut, it all boils down to bacteria.

Our bodies are literally crawling with bacteria, inside and out, but that's not necessarily a bad thing. Our skin, guts, and mouths are unique ecosystems called microbiota. And like any ecosystem, they need balance in order to thrive.

Many studies have suggested that the recent rise in inflammation-related illnesses could be related to microbial imbalances in our guts, and that those imbalances could be tied to changes in our environment and diet. One 2016 experiment found that eating the modern American diet, low in fiber and high in processed foods, could damage not only your microbiome but those of your descendants, too.

To better understand the link between these elements, scientists analyzed the way gut microbes consume, digest, and break down fiber.

Fascinatingly, they found that it's not the fiber itself that helps—it's what happens while your microbes are digesting it. As they grind up and break down chunks of fiber, they produce compounds called short-chain fatty acids. The release of these acids tells cells in the large bowel to start gobbling up as much oxygen as they can. This, in turn, decreases the amount of oxygen being released into the gut lumen, which is the open space in the intestine that comes into direct contact with digested food.

And lower oxygen levels in the lumen are a good thing. Harmful bacteria like Salmonella and E. coli need oxygen to survive. Speaking in a statement, senior author and microbiologist Andreas Bäumler called the gut "the site of constant turf wars between microbes."

The less oxygen the pathogens get, Bäumler said, the more likely it is that helpful microbes will flourish instead.

It's an interdependent system, first author Mariana X. Byndloss explained. "The beneficial gut bacteria that are able to break down fiber don't survive in an environment rich in oxygen, which means that our microbiota and intestinal cells work together to promote a virtuous cycle that maintains gut health."