Both cuneiform and hieroglyphs were developed around 4000 B.C. Among the earliest forms of writing, they both began as pictographic forms which over time became more abstract and included phonetic elements.
Cuneiform developed in Mesopotamia a little earlier than Egyptian hieroglyphs. Biologist Jared Diamond hypothesised that they developed early on to manage the increasingly complex government and trade needs. In the earliest forms of picture writing, objects were referenced with pictorial representations. An example of this is how, in both hieroglyphs and early cuneiform, the symbol for 'fish' is a simple picture of a fish. As cuneiform and hieroglyphics developed, phonetic elements were added to the written language, so that some symbols represented sounds in the spoken language.
While both scripts became more abstract, so that symbols represented ideas and feelings, cuneiform in particular left behind its pictorial system for combinations of lines and dots. The two scripts influenced each other throughout their development through trade and travel. Their shared phonetic characteristics were greatly influential on the development of western writing, and distinguish them from eastern scripts, in which symbols represent words rather than sounds. The influence of both scripts can be seen in ancient Greek, which appeared on the Rosetta Stone next to two forms of Egyptian hieroglyphs, and features many modified versions of cuneiform symbols.