Julius Wellhausen is famous for the Documentary Hypothesis.
He changed the way we looked at the formation of the Torah. In his theory, there was an original epic, modified by a storyteller we call J. Four hundred years later, this epic is modified by another storyteller we call P. Of course, long before anything is written, these stories are told and retold in oral form.
- J gets her name by calling God, Yahweh. J's narrative was formed in the 10th century BCE
- E calls God, Elohim. E represents the Northern Kingdom's view of history after the Israelite monarchy split in 922. (J represents the Southern Kingdom's view and eventually J and E are combined).
- D stands for Deuteronomic history which accounts for the Book of Deuteronomy and the books of Joshua, Judges, 1 & 2 Samuel, and 1 & 2 Kings (7th century BCE).
- P gets his name because he is a priest. P's narrative is dated in the 6th century BCE.
There are two separate creation accounts in Genesis.
Genesis 1:1-2:4a is a later account written by P in the 6th century during the Babylonian captivity.
Genesis 2:4b-4:16 is the earlier account written by J in the 10th century BCE. This tells the story of Adam, Eve, the garden, the serpent and so forth.
Since Wellhausen's time scholars have learned more about oral tradition. We don't think so much as individual authors sitting down and writing things. It is more accurate to these as strands of different traditions. Here is that same diagram with a bit more detail that includes the Deuteronomic history or former prophets: