As calamities and health crises are expected to recur and become more frequent, we rely more on cooperation to prevent similar situations and to cope with their aftermaths. However, it is not clear if, how and why people cooperate in uncertain situations where losses can result from inadequate cooperation. Through theoretical modelling, experiments and simulations, we show the behavioural patterns driving cooperation in a stochastic environment. Specifically, by introducing stochastic shocks to a threshold public goods game where one can randomly incur losses when group contributions are below a specific level, we investigate what happens to cooperation when disasters strike repeatedly. The findings show that compared to a control setting, cooperation is higher and persists when there is a risk for disasters to strike, and that this is sustained by unconditional cooperation. People give more and do not match the contributions of others, contrasting the conditionality observed in deterministic environments. In other words, we observe a contribution divergence in uncertain environments wherein some give unconditionally while others free-ride. We study three different types of uncertainty about the disaster: the probability of a disaster, additionally if it is uncertain how much cooperation is required to avoid them (threshold level), and how much losses will be incurred (impact). The results are similar in countries having different natural disaster risks, the Philippines and Sweden. Simulating for a longer time period suggests the importance of promoting unconditionality to foster sustained cooperation in facing an uncertain world.