Abstract: Natural ecosystems, in particular on the microbial scale, are inhabited by a large number of species. The population size of each species is affected by interactions of individuals with each other and by spatial and temporal changes in environmental conditions, such as resource abundance. Here, we use a generic population dynamics model to study how, and under what conditions, a periodic temporal environmental variation can alter an ecosystem’s composition and biodiversity. We demonstrate that using time scale separation allows one to qualitatively predict the long-term population dynamics of interacting species in varying environments. We show that the notion of competitive exclusion, a well-known principle that applies for constant environments, can be extended to temporally varying environments if the time scale of environmental changes (e.g., the circadian cycle of a host) is much faster than the time scale of population growth (doubling time in bacteria). When these time scales are similar, our analysis shows that a varying environment deters the system from reaching a steady state, and coexistence between multiple species becomes possible. Our results posit that biodiversity can in parts be attributed to natural environmental variations.