Many creation myths contain an element that chaos reigned before order emerged. There’s the Enuma Elish, Genesis, and Ovid’s Metamorphosis. They all imply that there was some sort of chaos until a god (ruler) commands or acts to create order by establishing laws. In Genesis the words used are tohu (toe-who) and bohu (bough-who), which mean unformed and unfilled more or less. They imply a certain amount of disorder. God is introduced using the word elohim, which is normally translated as God. However, this word is definitely broader than that. In few places, and there might only be two, it is used to designate the word rulers or kings.
If you dig deeper in your Biblia Hebraica Stutgarttensia (that’s the gold standard used for researching the old testament; it contains all the known variant readings in their original language), you will find more textual evidence pointing towards the meaning of elohim being rulers. Genesis 6 talks about the sons of God (benai ha’elohim) and the daughters of man (benot ha’adam). This passage has been misunderstood to say that angels were having sexual relations with human women. However taking the meaning of elohim to be rulers, we can safely say that this passage means the rulers were hogging all the women (just in a very different tone). This makes much more sense. It also means that Genesis 1 describes the rulers establishing boundaries, creating names, and decreeing order upon the chaos.
I think the fact that well developed societies had this type of creation myth tells us something about ourselves. Once a society has built a hedge against the randomness of life, they feel as though they have established order. As the generations progress, they begin to feel as though everything is orderly and that order should be demanded of everything. However, there is now a glaring crack growing, bifurcating the facade of that security. In quantum mechanics everything is a probability, nothing is certain until it is measured. Einstein spoke against this negative feature of the quantum by saying, “God is not a pair of dice.” normally translated, “God does not play dice.” Everything is based on randomness. This is a stochastic universe.
Mathematics is begining to tell us the same thing: Everything is based on randomness. The sequence of the prime numbers is random. Algorithmic information theory tells us that the closer to random something is the more dense the information content. A truly random number sequence cannot be compressed. This means that randomness is pure information.
It is the nature of order to emerge from chaos, because chaos represents dense information. Nature’s order comes from a careful balancing act of the creation of information, increasing entropy, and nature’s self organization. Nature, being a complex adaptive system, must let information occupy the most stable state it can form. Randomness is the engine that drives creation (in the present tense). It is probably even the explanation for the arrow of time. All this leads me to believe that order is an emergent property of randomness.