In 10,000 BCE the Neotholic revoltion starts and people begin to farm and domesticate animals instead of foraging. (Prehistory Beginnings to 3000 BCE)
Because of food surpluses the population increases significantly, paving the road for more and more complex societies. (The Neotholic Revolution)
Now that so many people are farming, others are focusing on other jobs. This is job speacialiazation. "Stability led to the new development of skills, people could now spend their time on making tools, pottery and clothing." (The Neotholic Revolution)
With so many new jobs , people make much larger settlements. The invention of the wheel in 3500 BCE contributed to these large towns. (Prehistory, Beginnings to 3000 BCE)
As the population is still increasing the previous large settlements turn into cities society is becoming more and more advanced by the minute.
As society becomes larger people need to keep things under control, they find the best way to do this is by creating a system of authority that can keep things safe and secure. This is the government.