The mammalian intestine harbors a community of trillions of microbes, collectively known as the gut microbiota, which coevolved with the host in a mutually beneficial relationship. Among the numerous gut microbial species, certain commensal bacteria are known to provide health benefits to the host when administered in adequate amounts and, as such, are labeled "probiotics." We review some of the mechanisms by which probiotics and other beneficial commensals provide colonization resistance to pathogens. The battle for similar nutrients and the bacterial secretion of antimicrobials provide a direct means of competition between beneficial and harmful microbes. Beneficial microbes can also indirectly diminish pathogen colonization by stimulating the development of innate and adaptive immunity, as well as the function of the mucosal barrier. Altogether, we gather and present evidence that beneficial microbes cooperate with host immunity in an effort to shut out pathogens.