Many organisms harbor microbial communities referred to as their microbiota, which aid the host in critical functions. Traditionally, the study of the evolutionary ecology of host-microbe relationships has focused on detrimental host-pathogen associations, but the evolution and maintenance of beneficial host-associated microbial communities and their interactions is as important to understand given the consequences for host health and fitness. I will discuss how key pollinators across diverse taxonomic groupings are host to different assemblages of gut microbes, and, even when these microbes are similar, differing histories with host ecology or other microbiota members can shape their evolution and function. Subsequently, I will focus on bumble bees and their largely coevolved and vertically transmitted core gut microbes that are critical for bee health, including for digestion, detoxification, and pathogen defense. Such beneficial functions are reliant on successful colonization and microbial community maintenance, and I will address the influence of host and bacterial genotypes, key host life-cycle events, and host immunity or infection in the maintenance or perturbation of the microbiota. Finally, I will relate the presented results back to our knowledge of the short- and long-term dynamics influencing gut microbiota structure and function that is vital for the health and well-being of organisms from humans to bees.