The prevailing theory among archaeologists holds that prehistoric people settled down as they began to grow crops and manage livestock and then built progressively more advanced civilizations with permanent homes and large religious and burial structures, including pyramids.
Other people continued hunting and gathering, but according to the prevailing view they lived apart from the permanent settlements and did not do permanent construction projects.
How people with radically different economies and ways of life interacted has been the subject of much speculation.
Source: Ancient Origins