The gut microbiome, which seems to be affected by our diet, plays an important role in reducing the growth of potentially harmful microbes, a study suggests.