Abstract. Metagenomics has revealed hundreds to thousands of microbial species coexisting in almost all microbiota. However, resource-competition models predict that the number of species in steady coexistence cannot exceed the number of resources. To address this puzzle, and to better understand the possible role of environmental conditioning and trade-offs in promoting diversity, we physically model the population dynamics of microbes that compete for steadily supplied resources. Our model spontaneously reproduces several notable features of natural ecosystems, including high diversity, keystone species, and population dynamics and abundances characteristic of neutral theory, despite an underlying non-neutral competition for resources.