Some bacterial species disappear entirely and then return, in a rhythm that likely reflects regular changes in the Hadza diet. Many gut bacteria that wax and wane drastically are rare in people living in industrialized societies.

“We don’t have a good grasp of what these seasonally varying microbes even do,” said Justin Sonnenburg, a microbiologist at Stanford University and lead author of the new study.

Each of us carries about 30 trillion bacteria, belonging to thousands of species. Dr. Sonnenburg hopes that by comparing the microbiomes of hunter-gatherers with those of people in different societies, scientists will be able to learn how diets influence their composition.

As more societies switch to a Western diet, their microbiomes may change, altering their health. “We have to think of ourselves as these composite organisms, with microbial and human parts,” Dr. Sonnenburg said.

Until recently, microbiologists have mainly studied the microbiomes of people who eat a Western diet. Now they are casting a wider net.

In 2013, Stephanie Schnorr, then a graduate student at the Max Planck Institute for Evolutionary Anthropology in Leipzig, Germany, began the first study of the Hadza microbiome.

At a meeting with community leaders, she and her colleagues explained their plan: to collect stool samples and study the microbes in a lab.

“One of the camp’s senior men said, ‘Well, we give it to the ground, so why not just give it to her?’” recalled Dr. Schnorr, now a postdoctoral researcher at the University of Oklahoma.

Dr. Schnorr eventually extracted DNA from microbes inside 27 Hadza and compared them with samples gathered from people in Bologna, Italy. In 2014, she and her colleagues reported some striking differences.

The Hadza hosted a much greater diversity of gut microbial species than did the Italians, the researchers found, and there were some fundamental differences in species they carried. Some that were common in the Hadza were rare or missing from the Italians.

The study raised many questions about what factors determined which species lived in a particular group of people.

In 2013, Jeff Leach, a visiting research fellow at King’s College London, began working with Tanzania’s National Institute for Medical Research to collect stool samples from the Hadza four times over the course of one year.

Some samples were collected during Tanzania’s dry season, others during the wet season. Dr. Sonnenburg oversaw an analysis of those samples from 188 of the Hadza. In the new study, published in the journal Science, he and his colleagues reported sharp fluctuations in composition of the gut bacteria.

Some species were more common in one season than the other; some simply disappeared altogether. A comparison of these samples with those taken by Dr. Schnorr confirmed the fluctuations to be a regular cycle.

“In terms of the structure of the Hadza microbiome, we can say we have a fairly good grasp on that,” Dr. Schnorr said. But the discovery of a seasonal cycle is new, for any human microbiome.

Researchers already knew that the composition of gut bacteria can shift quickly. “An abrupt change in diet will lead to an abrupt change in the gut microbiome, on the order of a day or two,” Dr. Sonnenberg said.

But no one had ever documented a long-term, predictable cycle in gut species among a group of healthy people going about their daily business.

Dr. Sonnenburg speculated that the diet of the Hadza dictates the composition of these bacterial communities. Throughout the year, the Hadza gather fruits from baobab trees.

But in the dry season, they also dig for tubers and eat lots of meat, because it is easier to hunt for animals on a parched landscape. In the wet season, they forage for berries and harvest honey from beehives.

In the new study, Dr. Sonnenburg and his colleagues also compared the Hadza microbiome with those of people in 17 other societies, including urban Americans and Yanomamo villagers in the Amazon rain forest.

The Hadza microbiome is most similar to those in traditional societies, and least to the industrialized ones. The researchers found that the species that set the Hadza apart from industrial societies the most are also the ones that are the most seasonal.

The families of bacterial species that swing most strongly over a year in the Hadza gut are extremely rare in developed countries. Researchers have no idea why.

The Hadza may offer clues about what the microbiome was like in other societies before diets were transformed by modern agriculture and industry. Refined sugar and other new foods, for instance, may have favored a new set of gut microbes over ones that fed on tough plant fibers.

And once people began eating the same foods year-round, a loss of seasonality may have meant that some ancestral bacterial species were lost.

“We’re in some weird, perturbed state where many of the microbes we co-evolved with are not equipped to flourish,” Dr. Sonnenburg speculated.

By comparing microbiomes around the world, Dr. Sonnenburg said it might be possible to understand how gut microbes linked to industrialization are affecting people’s health. He has hypothesized, for instance, that they may be causing chronic inflammation.

In their new study, the researchers found that microbes in the guts of Americans make more enzymes that degrade mucins, compared with those in the Hadza. These enzymes allow bacteria to harvest carbohydrates from the mucosal lining of the gut, rather than from plant fiber.