We often assume that the beginning of history is when people started leaving behind written texts- giving definite evidence of the past events, rather than oral tradition, which is easily confused.
Writing is an invention which required some part of the population to be able not to produce food - so that they could spend their time on inventing script. This mean that writing could only be invented in places of food abundance and social stratification - and cities often had those characteristics.