An important source of variation in animal experiments is the microbiome, but little is known about specific changes in the microbiota composition that cause phenotypic differences. In this article, the authors show that genetically similar laboratory mice obtained from four different commercial vendors exhibited marked phenotypic variation in their susceptibility to Salmonella infection. Faecal microbiota transplant into germ-free mice replicated donor susceptibility, revealing that variability was due to changes in the gut microbiota composition. Co-housing of mice only partially transferred protection against Salmonella infection, suggesting that minority species within the gut microbiota might confer this trait. Consistent with this idea, Velazquez and colleagues identified endogenous Enterobacteriaceae, a low-abundance taxon, as a keystone species responsible for variation in the susceptibility to Salmonella infection. Protection conferred by endogenous Enterobacteriaceae could be modelled by inoculating mice with probiotic Escherichia coli, which conferred resistance by using its aerobic metabolism to compete with Salmonella for resources. The authors conclude that a mechanistic understanding of phenotypic variation can accelerate development of strategies for enhancing the reproducibility of animal experiments.