While the conditions that favour the maintenance of cooperation have been extensively investigated, the significance of non-social selection pressures on social behaviours has received little attention. In the absence of non-social selection pressures, patches of cooperators are vulnerable to invasion by cheats. However, we show both theoretically, and experimentally with the bacterium Pseudomonas fluorescens, that cheats may be unable to invade patches of cooperators under strong non-social selection (both a novel abiotic environment and to a lesser extent, the presence of a virulent parasite). This is because beneficial mutations are most likely to arise in the numerically dominant cooperator population. Given the ubiquity of novel selection pressures on microbes, these results may help to explain why cooperation is the norm in natural populations of microbes.