The events and thematic devices presented in Genesis are seen throughout the rest of Scripture. Crucial doctrines begin in this text, from the attributes of God to the depravity of man. This is the primary goal of Genesis: to set up themes in the Bible, which will ultimately culminate with Jesus Christ.
Since Genesis is the first book of the Pentateuch, or Torah, Jews and Christians throughout history have upheld Moses as the author. In recent years, many scholars have questioned the idea of one single author composing all of the first five books of the Bible; thus, the documentary hypothesis was born. Documentary hypothesists believe that the writings of the Pentateuch actually come from a variety of different authors that were compiled together around the time of the Exile. However, this view is exactly what its title says, a hypothesis. There is little proof to support this sort of thought. Yet in regards to Moses being the author, both the Old and New Testament give clear support to his authorship, including Jesus Himself (Mark 10:5; Luke 16:29, 24:27; John 5:46).
The overarching theme of Genesis 1-11 is to introduce humanity to the one true God through the lens of four events that shaped all of human existence: the creation of the world, the fall of humanity, the great flood, and the scattering at Babel. In addition to this primary theme of revealing the Most High, Genesis gives beginning to almost all major doctrines found throughout the Bible. It is here that the theme of redemption is first seen as God gives grace to the Adam and Eve after their blatant rebellion against Him. Also, the first explicit promise of Jesus is made in chapter three, promising salvation and a renewal of creation. Genesis is the beginning of all biblical themes.
The theme of the second part of Genesis (chapters 12-50) is to introduce humanity to the one true God who faithfully and graciously makes and maintains covenants with His chosen people. By grace, the LORD promises blessings to Abraham and his family, and Genesis shows repeatedly that God’s promises can be trusted.
Moses likely wrote Genesis and the rest of the Pentateuch during the Israelites forty years of wandering in the wilderness. It is not clear how exactly Moses received the information found within Genesis, especially since the final events regarding Joseph occurred around four hundred years before Moses was born.
One possibility is that the accounts were passed down from generation to generation beginning with Adam telling Seth until Moses received them from his mother. Many scoff at such a thought, citing that even the passing of a simple message today can result in a completely different message by the time it reaches its source, and since there are many varying cultural traditions of creation and the great flood, they argue that this must have happened in those instances as well. Another thought is that God directly revealed to Moses the truth of these events. Though I lean toward the second one, either demands the work of God in the preservation of truth.