You really should read @Reggie_O_Donoghue’s fine posting (link at the bottom) about what can be found “between the lines” of the Genesis creation account!
It’s quite good! He shows how readers can make conclusions about what was motivating some of the scribe’s writings that go a long way to explain why the text is written the way it is written.
To be concise, it wasn’t written because they thought this is how the Earth and life was created … it was written to demolish the pagan ideas - - which we know existed prior to the Biblical literature - - could only be expressed as a contest between multiple gods doing ridiculous things !
So, aside from needing an etymological explanation for why Hebrews should rest on the Sabbath, Genesis uses a pagan skeleton where the only actor is God and humanity … no other gods!
Here is a sample:
“On day four, he are told that God created the great sea beasts. The great sea beasts are the only creatures in 1:21 which are explicitly named, which assigns special significance to them. The Hebrew word used, ‘Tannin’, literally refers to a sea serpent, and is the name of a sea serpent in Canaanite mythology. All mythologies have what is known as the ‘Chaoskampf’, where the chief God battles a serpent or dragon who is associated with chaos; Baal and Lotan, Ra and Apep, Zeus and Typhon, Teshub and Iluyanka, just to name a few examples.”
“By addressing special significance to the Tannin, the author is directly rebuking these pagan beliefs, and stressing the goodness of God by saying that the sea beasts are not adversaries of God, but his own creation. Again, this is not ‘refuting these ideas because of real events’ . . . there would be no reason for this to be in the narrative unless these beliefs already existed”
[ ^^^ And thus in need of contradiction! Note from @gbrooks9 ]