a few years ago an article posted here in HN explained that writing was basically invented for accounting. So first forms were depicting symbols for items to be accounted for, then by composition they created new symbols to represent multiple symbols.
what's fascinating is words, numbers, money and computation seem to have the same origin in those proto-cuneiform boxes.