Microbes providing public goods are widespread in nature despite running the risk of being exploited by\nfree-riders. However, the precise ecological factors supporting cooperation are still puzzling. Following\nrecent experiments, we consider the role of population growth and the repetitive fragmentation of\npopulations into new colonies mimicking simple microbial life-cycles. Individual-based modeling reveals\nthat demographic fluctuations, which lead to a large variance in the composition of colonies, promote\ncooperation. Biased by population dynamics these fluctuations result in two qualitatively distinct regimes of\nrobust cooperation under repetitive fragmentation into groups. First, if the level of cooperation exceeds a\nthreshold, cooperators will take over the whole population. Second, cooperators can also emerge from a\nsingle mutant leading to a robust coexistence between cooperators and free-riders. We find frequency and\nsize of population bottlenecks, and growth dynamics to be the major ecological factors determining the\nregimes and thereby the evolutionary pathway towards cooperation.