On its own, a single cell cannot exert more than a microscopic influence on its immediate surroundings. However, via strength in numbers and the expression of cooperative phenotypes, such cells can enormously impact their environments. Simple cooperative phenotypes appear to abound in the microbial world, but explaining their evolution is challenging because they are often subject to exploitation by rapidly growing, non-cooperative cell lines. Population spatial structure may be critical for this problem because it influences the extent of interaction between cooperative and non-cooperative individuals. It is difficult for cooperative cells to succeed in competition if they become mixed with non-cooperative cells, which can exploit the public good without themselves paying a cost. However, if cooperative cells are segregated in space and preferentially interact with each other, they may prevail. Here we use a multi-agent computational model to study the origin of spatial structure within growing cell groups. Our simulations reveal that the spatial distribution of genetic lineages within these groups is linked to a small number of physical and biological parameters, including cell growth rate, nutrient availability, and nutrient diffusivity. Realistic changes in these parameters qualitatively alter the emergent structure of cell groups, and thereby determine whether cells with cooperative phenotypes can locally and globally outcompete exploitative cells. We argue that cooperative and exploitative cell lineages will spontaneously segregate in space under a wide range of conditions and, therefore, that cellular cooperation may evolve more readily than naively expected.