On a low-fiber diet, they found, the population crashed, shrinking tenfold.

Dr. Bäckhed and his colleagues carried out a similar experiment, surveying the microbiome in mice as they were switched from fiber-rich food to a low-fiber diet. “It’s basically what you’d get at McDonald’s,” said Dr. Bäckhed said. “A lot of lard, a lot of sugar, and twenty percent protein.”

The scientists focused on the diversity of species that make up the mouse’s gut microbiome. Shifting the animals to a low-fiber diet had a dramatic effect, they found: Many common species became rare, and rare species became common.

Along with changes to the microbiome, both teams also observed rapid changes to the mice themselves. Their intestines got smaller, and its mucus layer thinner. As a result, bacteria wound up much closer to the intestinal wall, and that encroachment triggered an immune reaction.

After a few days on the low-fiber diet, mouse intestines developed chronic inflammation. After a few weeks, Dr. Gewirtz’s team observed that the mice began to change in other ways, putting on fat, for example, and developing higher blood sugar levels.

Dr. Bäckhed and his colleagues also fed another group of rodents the high-fat menu, along with a modest dose of a type of fiber called inulin. The mucus layer in their guts was healthier than in mice that didn’t get fiber, the scientists found, and intestinal bacteria were kept at a safer distance from their intestinal wall.

Dr. Gewirtz and his colleagues gave inulin to their mice as well, but at a much higher dose. The improvements were even more dramatic: Despite a high-fat diet, the mice had healthy populations of bacteria in their guts, their intestines were closer to normal, and they put on less weight.

Dr. Bäckhed and his colleagues ran one more interesting experiment: They spiked water given to mice on a high-fat diet with a species of fiber-feeding bacteria. The addition changed the mice for the better: Even on a high-fat diet, they produced more mucus in their guts, creating a healthy barrier to keep bacteria from the intestinal walls.