In addition to what Vladimir said: Complex societies could only emerge when agricultural techniques were advanced enough to produce a surplus which could sustain a larger number of craftsmen, tradesmen and, tongue-in-cheek, unproductive managers like nobility and priests.
This surplus enabled the emergence of cities and palaces: Places that housed large numbers of people who were not directly concerned with producing food.
These had to be fed and sustained with food produced in the countryside. The food needed to be transported and stored in the palaces and cities.
Any large storage facility needs bookkeeping.
We know e.g. from indigenous Australians that the human mind is able to perform astonishing feats of memorization. The modern version of such a system are the German Ludolf brothers. Imagine a barn the size of half a soccer field, filled with piles of scrap metal parts 15 feet high:
The parts, stored in a warehouse, are sorted by a homegrown "cluster principle" with only Peter Ludolf knowing which part is in which pile. Each of the four brothers has a specific task. It's up to Peter to locate the desired part whether the customer is at the door or on the phone.
This could work for a while also in an god-emperor's palace. But it is not robust. People die, and memory is fallible. At some point people will start scratching pictures of the goods and a simple number system with lines on the doors and amphorae. From there it is a very slippery slope to a pictographic script.
We must assume that (indirect, relayed) communication and migration even over long distances like Mesopotamia and China existed, spreading ideas like agricultural technology and perhaps even the "bookkeeping meme". A culture that didn't improve their agriculture was bound to disappear in the long term; those that did at some point needed writing.