We've known for a while that people who grow up on farms are less likely to have ailments related to the immune system than people who grow up in cities. Those include asthma, allergies, inflammatory bowel disease and multiple sclerosis.

Exposure to germs as a kid seems to be helpful, while living in an environment that's squeaky clean seems to pose risks for some illnesses. Still, nobody knew precisely why. But now some scientists say they think they've figured out the details of the " hygiene hypothesis."

They found that microbes in the gut keep a rare part of the immune system reined in. No microbes, and the immune cells go crazy in the lungs and intestines, increasing the risk of asthma and colitis. Add in the microbes, and cells in question, invariant natural killer T cells, retreat.

The discovery was one of those lovely "aha" moments in science. Or as says Richard Blumberg, the chief of gastroenterology at Brigham and Woman's Hospital in Boston, and co-author of the study says: "We made the serendipitous observation that these cells were dramatically enriched in the lung and colon in mice that lacked any microbes."

These are mice raised in totally germ-free environments in the lab. What really piqued the scientists' interest was that the immune response in the super-clean mouse innards looked very similar to what happens in diseases like asthma.

But they were still missing the connection with exposure to bacteria in early childhood. So Blumberg and his colleagues took pregnant germ-free mice and exposed them to microbes the day before they gave birth. The baby mice had fewer iNKT cells in their guts, even after they grew up.

The researchers also found that genetically altered mice without the iNKT cells don't get colitis, even if they were raised in a germ-free environment.

It's unclear which microbes help regulate the immune cells, according to Dennis Kasper, director of the Channing Laboratory at Brigham and Women's, and a co-author of the study, which was published online in Science. Figuring that out is very important, he says. "You can't just put any piece of dirt into a baby and direct the control of the immune system," he says.

He thinks there are a very few special molecules in the 500 to 1,000 species in the intestine that control the immune cells, but it's going to take a lot more work to figure that out.

Of course, this study was done in mice, but it gets at some fundamental questions that would be impossible ask in humans. No germ-free cages for us.

And their findings square with 20 years of epidemiological research showing that exposure to microbes and parasites in childhood reduces the risk of autoimmune disease.

There's evidence that children who are given antibiotics early in life are more likely to have immune-based problems like asthma and food allergies. There's even some evidence that women might have more autoimmune diseases than men because they're kept cleaner than boys as children.

These disorders are more common in developed countries, and in people who move from the developing world into tidier lands.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.