Beginning around 9500 BCE in the Fertile Crescent, and independently in regions including China, Mesoamerica, the Andes and New Guinea, people domesticated cereals and animals and shifted from foraging to cultivating fixed plots. This produced a storable food surplus that could support populations far larger and denser than hunting and gathering allowed. Communities became sedentary, investing labour in land, granaries and durable dwellings. Over millennia this transition spread across much of the inhabited world.
By tying populations to land and to storable surplus, it created permanent settlements, notions of property in land and the demographic base for social hierarchy. From this agrarian foundation the first towns and cities eventually grew.