Various studies have investigated cognitive mechanisms underlying culture in humans and other great apes. However, the adaptive reasons for the evolution of uniquely sophisticated cumulative culture in our species remain unclear. We propose that the cultural capabilities of humans are the evolutionary result of a stepwise transition from the ape-like lifestyle of earlier hominins to the foraging niche still observed in extant hunter-gatherers. Recent ethnographic, archaeological and genetic studies have provided compelling evidence that the components of the foraging niche (social egalitarianism, sexual and social division of labour, extensive co-residence and cooperation with unrelated individuals, bilocality, fluid sociality and high between-camp mobility) engendered a unique multilevel social structure where the cognitive mechanisms underlying cultural evolution (high-fidelity transmission, innovation, teaching, recombination and ratcheting) evolved as adaptations. As a result, multilevel sociality is behind a ‘social ratchet’ or irreversible task specialisation that splits the burden of cultural knowledge across individuals, which may explain why human collective intelligence is uniquely able to produce cumulative culture. The foraging niche perspective accounts for why a complex gene-culture dual inheritance system evolved uniquely in humans, and interprets the cultural, morphological and genetic origins of Homo sapiens as a process of recombination of innovations appearing in differentiated but interconnected populations.