Gen. 1:27, the mythological account.
Gen. 2:7, the theological account.
Gen. 6:4, the historical account.
― 1:26-27. And God (Elohim) said, “Let us make humankind in our image, after our likeness. They shall rule the fish of the sea, the birds of the sky, the cattle, the whole earth, and all the creeping things that creep on earth.”
And God (Elohim) created humankind in the divine image, creating it in the image of God (Elohim), creating them male and female.

This is the account provided by the ancient mythographer who recorded the cultural memory of the ancient Israelites.
We, ‘humans’, were made by the Elohim, in the image of the Elohim male and female, so we are the sons and daughters of the Elohim, and the Elohim looked exactly as we do.
Now please note the translation according to KJV:
So God created man in his own image, in the image of God created he him; male and female created he them.
Elohim is a masculine noun in the plural number and as such is treated by both the ancient mythographer and the translators of the Jewish Publishing Society. King James Version transformed the mythological account into a theological one by presenting “Elohim” as one person, the creator God.
This account is historically true because the kings in the ancient Near East were producing new citizens and slaves in human breeding grounds.
―2:7 And Yahweh Elohim formed man of the dust of the ground, and breathed into his nostrils the breath of life; and man became a living soul.
2:22 And the rib, which Yahweh Elohim had taken from man, made he a woman, and brought her unto the man.
This is the theological account. Most scholars agree that the rib of Adam evolved out of the “bone” mentioned in Enuma Elish, the Babylonian creation account.
5. “I shall compact blood, I shall cause bones to be,
6. “I shall make stand a human being, let “Man” be its name.
7. “I shall create human beings,
―6:4 It was then, and later too, that the Nephilim appeared on earth – when divine beings (the sons of Elohim) cohabited with the human women, who bore them offspring. Such were the heroes of old, the men of renown.

Here we have the same story as in 1:27 only that in this case those who raped the human women are our ancestors, the sons of the Elohim.
“Nephilim” literally means “the fallen ones”, “the exterminated ones”, “the ones driven to extinction”.
Who were those exterminated ones?
According to the Jewish scholars who translated the Bible into Greek (3rd century BCE), the Nephilim are those who all the other people groups of the ancient world called “Giants”.
οἱ δὲ γίγαντες (giants) ἦσαν ἐπὶ τῆς γῆς ἐν ταῖς ἡμέραις ἐκείναις· καὶ μετ᾿ ἐκεῖνο, ὡς ἂν εἰσεπορεύοντο οἱ υἱοὶ τοῦ Θεοῦ (the sons of God) πρὸς τὰς θυγατέρας τῶν ἀνθρώπων, καὶ ἐγεννῶσαν ἑαυτοῖς· ἐκεῖνοι ἦσαν οἱ γίγαντες (but the word in the original is “gibborim” not “Nephilim) οἱ ἀπ᾿ αἰῶνος, οἱ ἄνθρωποι οἱ ὀνομαστοί (men of renown).
Numbers 13:32 and 13:33
On arriving at the land of Canaan the ancestors of Israelites found no people there (the country had devoured its settlers) only the Giants.
Diodorus Siculus, Book 4, 21.5
Heracles then moved on from the Tiber, and as he passed down the coast of what now bears the name of Italy he came to the Cumaean Plain. Here, the myths relate, there were men of outstanding strength the fame of whom had gone abroad for lawlessness and they were called Giants.
These Giants were also exterminated, and the same happened with the Giants the ancestors of the Norsemen found on arriving for the first time in Northern Europe.
The Giants are known from the legends of most, if not all, people groups of Eurasia (and the Americas where they migrated) but not of Africa because… no Neanderthals ever lived in Africa!
Egypt is in Africa but it is also part of the Near East. Here is the Egyptian version of the creation account of Gen. 6:4.

The Egyptians were operating human breeding grounds where supposedly primitive women (foreigners, non-Egyptians) were raped by Egyptian noblemen and produced normal modern people (“the men of renown” of the Bible). The raping was done by Ra (the divine beings -the sons of Elohim- of the Bible).
So, by “phallus of Ra” the Egyptians meant their own phallus; they meant themselves. Ra was them: the Egyptian noblemen!
The same happens with the Israelites. Those who enslaved the primitive Canaanites and raped their women were the Israelites themselves. They were the sons of Elohim!
The story of Sodom and Gomorrah was written to record the event when the Israelites ceased producing more Israelites by using non-Israelite women.
Here is the analysis of the story, if you are interested:
Analyzing the Sodom story
Gen. 2:7, the theological account.
Gen. 6:4, the historical account.
― 1:26-27. And God (Elohim) said, “Let us make humankind in our image, after our likeness. They shall rule the fish of the sea, the birds of the sky, the cattle, the whole earth, and all the creeping things that creep on earth.”
And God (Elohim) created humankind in the divine image, creating it in the image of God (Elohim), creating them male and female.

This is the account provided by the ancient mythographer who recorded the cultural memory of the ancient Israelites.
We, ‘humans’, were made by the Elohim, in the image of the Elohim male and female, so we are the sons and daughters of the Elohim, and the Elohim looked exactly as we do.
Now please note the translation according to KJV:
So God created man in his own image, in the image of God created he him; male and female created he them.
Elohim is a masculine noun in the plural number and as such is treated by both the ancient mythographer and the translators of the Jewish Publishing Society. King James Version transformed the mythological account into a theological one by presenting “Elohim” as one person, the creator God.
This account is historically true because the kings in the ancient Near East were producing new citizens and slaves in human breeding grounds.
―2:7 And Yahweh Elohim formed man of the dust of the ground, and breathed into his nostrils the breath of life; and man became a living soul.
2:22 And the rib, which Yahweh Elohim had taken from man, made he a woman, and brought her unto the man.
This is the theological account. Most scholars agree that the rib of Adam evolved out of the “bone” mentioned in Enuma Elish, the Babylonian creation account.
5. “I shall compact blood, I shall cause bones to be,
6. “I shall make stand a human being, let “Man” be its name.
7. “I shall create human beings,
―6:4 It was then, and later too, that the Nephilim appeared on earth – when divine beings (the sons of Elohim) cohabited with the human women, who bore them offspring. Such were the heroes of old, the men of renown.

Here we have the same story as in 1:27 only that in this case those who raped the human women are our ancestors, the sons of the Elohim.
“Nephilim” literally means “the fallen ones”, “the exterminated ones”, “the ones driven to extinction”.
Who were those exterminated ones?
According to the Jewish scholars who translated the Bible into Greek (3rd century BCE), the Nephilim are those who all the other people groups of the ancient world called “Giants”.
οἱ δὲ γίγαντες (giants) ἦσαν ἐπὶ τῆς γῆς ἐν ταῖς ἡμέραις ἐκείναις· καὶ μετ᾿ ἐκεῖνο, ὡς ἂν εἰσεπορεύοντο οἱ υἱοὶ τοῦ Θεοῦ (the sons of God) πρὸς τὰς θυγατέρας τῶν ἀνθρώπων, καὶ ἐγεννῶσαν ἑαυτοῖς· ἐκεῖνοι ἦσαν οἱ γίγαντες (but the word in the original is “gibborim” not “Nephilim) οἱ ἀπ᾿ αἰῶνος, οἱ ἄνθρωποι οἱ ὀνομαστοί (men of renown).
Numbers 13:32 and 13:33
On arriving at the land of Canaan the ancestors of Israelites found no people there (the country had devoured its settlers) only the Giants.
Diodorus Siculus, Book 4, 21.5
Heracles then moved on from the Tiber, and as he passed down the coast of what now bears the name of Italy he came to the Cumaean Plain. Here, the myths relate, there were men of outstanding strength the fame of whom had gone abroad for lawlessness and they were called Giants.
These Giants were also exterminated, and the same happened with the Giants the ancestors of the Norsemen found on arriving for the first time in Northern Europe.
The Giants are known from the legends of most, if not all, people groups of Eurasia (and the Americas where they migrated) but not of Africa because… no Neanderthals ever lived in Africa!
Egypt is in Africa but it is also part of the Near East. Here is the Egyptian version of the creation account of Gen. 6:4.

The Egyptians were operating human breeding grounds where supposedly primitive women (foreigners, non-Egyptians) were raped by Egyptian noblemen and produced normal modern people (“the men of renown” of the Bible). The raping was done by Ra (the divine beings -the sons of Elohim- of the Bible).
So, by “phallus of Ra” the Egyptians meant their own phallus; they meant themselves. Ra was them: the Egyptian noblemen!
The same happens with the Israelites. Those who enslaved the primitive Canaanites and raped their women were the Israelites themselves. They were the sons of Elohim!
The story of Sodom and Gomorrah was written to record the event when the Israelites ceased producing more Israelites by using non-Israelite women.
Here is the analysis of the story, if you are interested:
Analyzing the Sodom story