Animal tuberculosis (TB) is endemic in wild boar (Sus scrofa), red deer (Cervus elaphus), fallow deer (Dama dama) and cattle in south and central Spain. In order to clarify the processes that operate in the medium and long-term, we studied TB at the wildlife–livestock interface in Doñana National Park for 14 years (2006–2018) in relation to host density, stochastic factors (rainfall) and environmental features (e.g., aggregation points such as waterholes). Wild boar showed the highest prevalence of TB (76.7%), followed by red deer (42.5%), fallow deer (14.4%) and cattle (10.7%). We found evidence of relevant epidemiological processes which operate over the long-term and interact with host and community ecology. Interestingly, the effect of high wild boar population density on increased TB rates was mediated by sows, which could determine high incidence in young individuals already in maternal groups. Rainfall significantly determined a higher risk of TB in male red deer, probably mediated by sex-related differences in life history traits that determined more susceptibility and/or exposure in comparison to females. The positive association between the prevalence of TB in fallow deer and cattle may indicate significant interspecies transmission (in either direction) and/or similar exposure to risk factors mediated by ecological overlapping of grazing species. The identification of long-term drivers of TB provided evidence that its control in extensive pastoral systems can only be achieved by targeting all relevant hosts and integrating measures related to all the factors involved, such as: population abundance and the aggregation of wild and domestic ungulates, environmental exposure to mycobacteria, cattle testing and culling campaigns and adjustments of appropriate densities.