Before I begin, a note: I cannot recommend strongly enough Jared Diamond's Guns, Germs, and Steel.
The fifth pillar of human morality, as elucidated by Dr Jonathan Haidt is that of Sanctity/Purity. We maintain purity and eschew things that would make us dirty, physically and spiritually. Typically, in the West, this means not having sex. All across humanity, it seems to mean not having much to do with women. Something about human society is deeply misogynistic and anti-sex: Jesus was born of a virgin, the Buddha was born through a slit in his mother's side, pagan/animist tribal beliefs often have an unpleasant fixation with avoiding menstruating women. Misogyny aside, there are more examples: vegetarians and vegans eschew animal products, usually on moral grounds; we have strong disgust aversions to even associating with bodily wastes and often with the fluids of others; corpses and other near-human images evoke strong negative reactions; and there's something deeply disturbing about clowns.
I think the Purity/Sanctity response began (and this entire post is going to be supposition) as primarily a physical disgust reaction to keep our animal ancestors away from certain things; don't eat things that will make you sick. Later it coupled with methods of socialization and shame response to reinforce behaviors to promote cooperation and peace within a group. After that, I think it became very conceptual.
My understanding of the development of humanity, society, and civilization is that we exploded out of Africa and settled everywhere a living, meager or otherwise, could be scratched. Fecund environments were altered, whether consciously or not, to be more productive. Our modern understanding of the hunter-gatherer model as a nomadic lifestyle is based upon the fact that only people in marginal landscapes that cannot support agriculture still pursue the HG lifestyle and the paucity of resources forces a nomadic or semi-nomadic existence on them. But the majority of the Earth is quite happy to let us grow fat in one place even without farms, and populations would have settled in place, burgeoned, reached an equilibrium, altered their environment, reached a new equilibrium, and so on.
Farming wouldn't have been an overnight discovery. Rather, the people of an area would have exhaustively explored every single native plant and animal for edibility and perfected a method for harvesting it wild. This would have meant learning everything about growing/breeding seasons and inventing and perfecting the correct tools for the job. What would have followed would have been altering the environment so as to expand the range for the wild plant to grow and cultivating it in place. The next step, perhaps final, would have been relocation and deliberate cultivation. A modern example of this is the cultivation of various plants in the Australian desert by the aboriginal peoples there, and the aborted development of fish farming begun in, I believe, the islands off that continent's southern coast. Another example in recorded history was that of the deliberate cultivation of the American landscape by the Native Americans, as can be read about in Charles C. Mann's 1491: New Revelations of the Americas Before Columbus; the first Europeans to reach the east coast of what are now the United States and Canada described a thickly settled landscape that resembled open parkland. The natives cultivated an open forest with limited undergrowth by repeatedly burning the forest, thus maintaining an environment ideally suited for hunting. They also maintained thick groves of nut-bearing trees, like hickory. These are just a few documented examples along the arc of deliberate, pre-agricultural landscape cultivation.
At all points along that scale, the population would have grown to the maximum allowable by the environment and the tools/methods discovered by those living there. From a tribal band of a few dozen members, the family group would eventually have been forced to a higher density. That was when trouble would have started. A modern day example was tellingly documented in Diamond's book, with a tribe from Papua New Guinea. A tribe of permanently settled HGs lived in a particularly fecund marshland, harvesting the calorie-rich pith of a certain palm tree, primarily. The population grew to a few hundred and then the inevitable happened; two men got in a fight. One killed the other and a cycle of revenge killings began that left the tribe with only a few dozen alive, alternately terrified and full of rage.
Essentially, the problem was strangers. In a small group, everyone knows everyone else. They may not all like each other, but everyone likes everyone well enough and rule three, In-Group Loyalty, keeps frictions from boiling over. But when the population gets too large, it becomes impossible for everyone to know everyone; the rough limit is somewhere between four and five hundred people. Once a population has strangers, then the disincentive for fighting goes away. But In-Group Loyalty still exists and they're going to get revenge. How many times do you think we repeated that tribe's tragedy? How many people on the verge of developing civilization instead tore themselves apart with pointless violence?
Civilization apparently began in just a few places and spread from there. By cultural diffusion, by population spread, and through conquest, those civilizations spread their examples across the globe. We modern humans are the heritors of a precious legacy; somewhere in the past, someone figured out the key. The question: how can we get along with strangers without killing them? The answer, and this may strike you as odd: Religion. Well, eventually.
To be continued.