Around 8,500 BC, trade among the ancient Mesopotamians grew more complicated, and merchants needed a record-keeping system to keep track of everything. They came up with a series of tokens, with each token representing a commodity—a jug of oil, a jar of perfume, a dog, a cow, a lion, or (very popular back then) a sheep. As this system became even more complicated and people amassed more property (and, therefore, tokens), merchants began to store their sheep-figurines in contraptions like the one pictured above, round ceramic envelopes called bullae.
Though these ancient bills-of-lading were a great step forward, there was one small problem: a clay envelope isn’t exactly the same as its FedEx counterpart, and you had to break open the bulla anytime you wanted to see what you owned. One day, somebody must have gotten sick of this, and had a very bright idea—to draw representations of the tokens on the outside of the clay. And then, sometime later, another brilliant sheep-trader must have said to his Mesopotamian sheep-trading brethren, “Hey, Enlil, Gishtu, any idea why we still need the tokens? We can just look at the outside of the clay envelope to see what we own.”
And thus, the birth of writing. All of this was discovered in the late 1960s by Denis Schmandt-Besserat when she noticed that the illiterate herdsmen around her dig site were still using tokens to trade—almost identical to the ones she just happened to be digging up. (Schmandt-Besserat is one of my favorite archeologists, in that she thought long and hard about the original interchange between art and writing. More on that, soon.)
More info on the above may be found here. In the meantime, we should consider ourselves lucky! Thanks to technological advancements since the 9th Century BC, we are no longer reliant on clay envelopes to keep track of our sheep—instead, we can just use the iPhone sheep-counting application: