Priority effects, where arrival order and initial relative abundance modulate local species interactions, can exert taxonomic, functional, and evolutionary influences on ecological communities by driving them to alternative states. It remains unclear if these wide-ranging consequences of priority effects can be explained systematically by a common underlying factor. Here, we identify such a factor in an empirical system. In a series of field and laboratory studies, we focus on how pH affects nectar-colonizing microbes and their interactions with plants and pollinators. In a field survey, we found that nectar microbial communities in a hummingbird-pollinated shrub, Diplacus (formerly Mimulus) aurantiacus, exhibited abundance patterns indicative of alternative stable states that emerge through domination by either bacteria or yeasts within individual flowers. In addition, nectar pH varied among D. aurantiacus flowers in a manner that is consistent with the existence of these alternative stable states. In laboratory experiments, Acinetobacter nectaris, the bacterium most commonly found in D. aurantiacus nectar, exerted a strongly negative priority effect against Metschnikowia reukaufii, the most common nectar-specialist yeast, by reducing nectar pH. This priority effect likely explains the mutually exclusive pattern of dominance found in the field survey. Furthermore, experimental evolution simulating hummingbird-assisted dispersal between flowers revealed that M. reukaufii could evolve rapidly to improve resistance against the priority effect if constantly exposed to A. nectaris-induced pH reduction. Finally, in a field experiment, we found that low nectar pH could reduce nectar consumption by hummingbirds, suggesting functional consequences of the pH-driven priority effect for plant reproduction. Taken together, these results show that it is possible to identify an overarching factor that governs the eco-evolutionary dynamics of priority effects across multiple levels of biological organization.