If we think of the growth of civilization as tiny individual and self-contained units, we can begin to see that centralizing groups geographically was a function of humans realizing that they needed others for support.
I don't think it happened consciously like that
I think communities settled in fertile areas and then propsered and expanded and then merged with other communities when they came into contact with them
As for 'civilisation' that is really where things took a bad turn. People began agriculture and they developed surpluses which lead to barter and then trade which in turn was driven forward by the development of writing as a way of recording things
This then created castes as some became more wealthy than others and some could read and write whilst others couldn't and so on. This process has only really occured in the last 10,000 years and with it the developement of hierarchies. Its when people started to set themselves apart as different social groups that you can see people consciously acting in their self interest
Before that people were hunting and gathering and living as one being in a sense. They weren't making conscious decisions to live within a certain postcode and to do a certain career because they thought that would boost their status...that simply was not a factor
So humans did not 'realise' that they needed others for support THEY HAD ALWAYS SUPPORTED EACH OTHER
On an individual level, sure we were always together...but if we think of it in units - a group of 3-4 families as a sustainable unit - they came together to form tribes because it was easier for them to survived within a larger group.
People have always been living in tribes. They did not think consciously 'this will be good for us' it was just the natural thing to live in groups. As groups grew and their territories exapanded they would inevitably have started breeding with their neighbouring groups and merged
Scientists have found that male whales that travel into new areas of the ocean prove popular with the females there because their whale song sounds exotic to the females
The choice to come together is predominately one of self-interest, as their change of survival significantly increased when they grouped up. This idea of smaller groups coming together to survive has expanded over the centuries to form cities. So while we might not see it now, the essence and purpose of cities was to increase our ability to survive- a function of self-interest!
There was no 'grouping up'! Humans were ALWAYS grouped up
Cities were the product of agricultural surpluses leading to grain stores which allowed some people to NOT work but form exploitative groups that lived off the labours of the farmers for example trade exchanges, priests, royal families, warriors
These classes then tried to expand their power by attacking other groups leading to people putting walls around their settlements
You could argue that the caste system is what created the conscious idea of self interest. You could also say that the caste system is what really fired competition and conflict
But before that people were not thinking in terms of their self interest, they just were following their purpose just like any other animal
Going into cities is perhaps the moment of leaving the garden of eden in a sense....that was our fall.....it was when self interest became a conscious issue for the leisured classes; the majority of people would still have been living a very community based life; its really the upper castes: the kings and queens, the warriors and the priests who didn't have to toil in the fields who had the free time and lack of purpose to scheme and focus on status
Even in norman times however, which could perhaps be seen as a boom time for the warrior caste, the competing warrior caste still developed a code between themselves called 'chivalry' and 'courtesy' whereby they maintained a certain mindset which softened their behaviour towards each other as they felt a kinship towards each other (and that was amongst the most ruthless of humans!)