How did cuneiform arise?
Now, the general belief is that the Sumerian writing system evolved from the above characters. The idea is that they turned them into crude outlines, which became simpler over time. There are some competing ideas, but they don't matter for this.
I do wonder if some of these characters were adopted by the Egyptians. The very early forms do look a bit close to Egyptian hieroglyphs but I'm unaware of a link and, frankly, there's not much you can do with primitive outline art.