In Sumer, Bactria and Babylon, priests were in charge of water engineering, and constructed elaborate aqueducts to keep crops irrigated, a task that required constant supervision.
Religion was created to anoint the local King with a divine right to rule, while giving his High Priest a mythical ceremonial tradition stretching back to creation. Those building the biggest temples were able to sweep aside the shaman traditions because temples were the theme parks of their time. Costumes and rituals provided the sense of enchantment required to keep the populace happy and productive.
Egyptian creation myths seem influenced by Sumer, as the same basic pantheon of Gods is put into play. However, the biggest difference in Egypt is no aqueducts are necessary because the Nile delivers the needed water when it floods every season, leaving a nutrient-rich soil behind when it recedes.
In the beginning there was only Nu, dark, watery abyss of chaos.
Out of Nu rose Benben. (A great earthen pyramid believed to have happened near Thebes.)
Above Benben, Ra, (Sun God) was born.
Then Atum was born, King of all Gods, who self-created the God of Wind and Goddess of Fertility.