The story of Adam and Eve, Cain and Abel, Noah and the Ark are oral history. Written history existed in Abraham’s time... But not much earlier. From Abraham to Moses oral and written history became focused. Then Moses went to Saudi Arabian Peninsula and learned their oral and written history.
With all that oral and written history, Moses became an editor (directed by God) in choosing what got into the Genesis and what didn’t make the cut.
Actually, Aaron, his brother wrote Genesis based on the verbal story given to him by Moses. The story was based on The Epic of Gilgamesh, which was taught to him when he was young.