Abstract
Many traits influence fitness indirectly by modifying shared environments that are transmitted across generations, a process known as ecological inheritance. Here, we investigate how variation in traits to improve common resources emerges when locally modified environments show ecological inheritance. Using eco-evolutionary modeling, we reveal that ecological inheritance, when combined with limited dispersal, can facilitate the coexistence of two types with opposite ecological legacies: environmental helpers, who improve the local environment for the future at a personal cost, and environmental free riders, who benefit without contributing to the detriment of future generations, particularly when interactions among helpers generate diminishing returns. This polymorphism generates lasting spatial heterogeneity in environmental quality and, consequently, in survival and reproduction-particularly under isolation-by-distance, where it creates stable clusters of high- and low-quality habitats across an otherwise homogeneous landscape. These findings reveal how ecological inheritance and spatial structure interact to stabilize polymorphism, potentially driving long-term behavioral, ecological, and fitness variation across diverse biological systems.