The early dynastic period in Egypt and the development of Sumer occur at roughly the same period. Both cultures were essentially theocratic, with a centralized political authority closely linked to and legitimated by a temple hierarchy. They both developed writing and elaborate law codes at the same time.
They differed in that Mesopotamia consisted of numerous independent city states while Egypt was more closely unified. The rrigation system based on innundations of the Nile required larger scale coordination than Mesopotamian agriculture. Egyptian religion emphasized the dead more than Sumerian, and Sumerian legal codes and sensde of the king as a purveyor of justice for the orphan, widow, etc was stronger.