The ecological and evolutionary mechanisms that influence the population dynamics of infectious diseases remain an active area of research of relevance to fundamental biology and applied public health. Here, I have considered rotavirus as a study system to better understand the effect of environmental drivers on transmission dynamics, and strain competition in the context of evolution on pathogen diversity. I first studied the effect of climate variability on rotavirus population dynamics in a heterogeneous urban landscape, and compared to rural ones in a developing country, Bangladesh. To carry out this project, I implemented a process-based model of pathogen spread in the core and periphery of Dhaka, and relied on surveillance data to address the role of the monsoons and how this varied in different parts of the city. These results show that the inclusion of spatial information is essential to better understand the seasonality and inter-annual variation of the disease transmission and its response to climate anomalies. I then extended the epidemiological model to consider different serotypes and to interrogate serotype-specific surveillance data to understand the role of host immunity on rotavirus diversity. The main results of this work reveal a strong effect of generalized immunity on shaping this diversity. Lastly, I developed a theoretical approach to understand the effect of host-pathogen heterogeneity on pathogen diversity in the context of different immune responses. These results emphasize the importance of considering two kinds of phenotypic differences underlying also distinct kinds of competition when studying pathogen diversity, namely absolute differences that allow viruses to exploit different hosts (as resources), and frequency-dependent differences related to antigenic traits and resulting immunity. In particular, I emphasized the recognition that these two trait axes may not be independent. Improvements of current vaccines of limited efficiency in the developing world should result from an increased understanding of ecological and evolutionary mechanisms that shape rotavirus diversity.