Stilwell P, O’Brien S, Hesse E, Lowe C, Gardner A & Buckling A (2020) Resource heterogeneity and the evolution of public-goods cooperation. Evolution Letters doi: 10.1002/ev13.158Heterogeneity in resources is a ubiquitous feature of natural landscapes affecting many aspects of biology. However, the effect of environmental heterogeneity on the evolution of cooperation has been less well studied. Here, using a mixture of theory and experiments measuring siderophore production by the bacterium Pseudomonas aeruginosa as a model for public goods based cooperation, we explore the effect of heterogeneity in resource availability. We show that cooperation in metapopulations that were spatially heterogeneous in terms of resources can be maintained at a higher level than in homogeneous metapopulations of the same average resource value. The results can be explained by a positive covariance between fitness of cooperators, population size, and local resource availability, which allowed cooperators to have a disproportionate advantage within the heterogeneous metapopulations. These results suggest that natural environmental variation may help to maintain cooperation.