According to Chapter 12 of Guns, Germs and Steel, why did writing arise?
Diamond says that the first writing system emerged in Mesopotamia out of accounting techniques that began by simply using some sort of clay tokens. Eventually, record-keepers began using flat clay tablets to mark on with a stylus, and from there they began parsing out the symbols into organized rows. Diamond says that the "first Sumerian writing signs were recognizable pictures of the object referred to" but that eventually, the signs came to represent abstract ideas. Over time, scribes began to use symbols to represent phonetic sounds, a major breakthrough that scholars call the "rebus principle." But it all began with simple record-keeping techniques used at temples and other administrative centers to keep track of taxes and tributes paid in kind. Mesoamerican writing was developed independently (2500 years later) of Old World writing systems, but is organized in similar ways to Sumerian writing, and, scholars think, with similar purposes.
Source: Diamond, Guns, Germs, and Steel, 220.