Genesis 1:2 presents a world in watery chaos. How is Yahweh going to bring order? Why a watery chaos? Ancient Israelites would have seen a watery chaos at the beginning of a story as a genre trigger for a creation story (what we call a "cosmogony"). In the same way we think, “This is going to be a fairytale”, when we hear the words "once upon a time," an Israelite would think, “This is going to be a creation story”, when they heard "watery chaos" (i.e. "now the earth was formless and void and darkness was over the surface of the deep").
There are four elements at the beginning of creation that find close parallel to Egyptian beliefs about creation (a separate post will look at Mesopotamian parallels): Emptiness (i.e., an earth that is "formless and void"), darkness, the deep (i.e., the primeval sea), and the spirit of God (some translations have "mighty wind," - but that's a post for another day). Egyptian texts (more specifically, Hermopolitan texts) feature four deities that are frequently called "the chaos gods": Nu, whose name means the watery one and who is called the father of the gods (His name is later rendered Nun from the Egyptian word for inert.); Huh, whose name means infinity or boundlessness; Kuk who is darkness; and Amun, the god of wind, whose name means hiddenness.
Nun = the deep
Huh = the earth that is 'formless and void'
Kuk = darkness
Amun = spirit (or wind) of God
The image portrayed both in Genesis 1:2 and in Egyptian texts is that of a cosmos that is without proper form. The creative activity of the deities brings order and function out of the initial inert chaos. Which god is actually doing the creating varies in Egyptian texts. No attempt is made to explain the origin of the watery chaos in any text from the ancient Near East. Apparently they didn't care. However, there is general agreement that life springs from the primeval sea.
What's the point?
1) We need to understand that ancient Israelites, especially the Exodus generation, were not monotheists. They needed to be taught that their God, Yahweh, was in fact the creator God. They needed to understand that their God put each facet of the created world into its correct place, for a specific purpose.
2) For us, I think it's helpful to see that God enjoys and is capable of bringing order out of chaos. God has an ability to make things, even seemingly crazy, chaotic things in our lives, work together for good.