Identifying the factors that modulate cooperative and competitive behaviours is the key to understanding social evolution. However, how ecological factors affect social conflict and their fitness consequences remain relatively unexplored. Here, using both a game-theoretical model and empirical data, we show that Taiwan yuhinas (Yuhina brunneiceps)--a joint-nesting species in which group members are unrelated--employ more cooperative strategies in unfavourable environmental conditions. Fighting duration was lower, fewer total eggs were laid and incubation was more likely to start after all females completed egg laying (which causes more synchronous egg hatching). Surprisingly, as a consequence, there were more surviving offspring in unfavourable conditions because the cooperative strategies resulted in fewer dead nestlings. To our knowledge, this study is the first theoretical analysis and empirical study demonstrating that an unfavourable environment reduces social conflict and results in better fitness consequences in social vertebrates.