"Who Wrote the Bible", Friedman- deals with the issue in depth
summary from "The Straight Dope" website:
250 to 1000 BC - Conquest of the land of Canaan begins before 1200, and the tribes of Israel form a loose confederation. The histories of the tribes of Abraham, Isaac, Jacob, Joseph, and Moses are told orally, handed down from generation to generation.
Around 1000 to 950 BC - The tribes are united under King David. Many of the stories are written down by the author J. These stories describe the creation of the universe, the birth and history of the tribes and their special relationship with God. The stories have an intense focus on morality, on examples of behavior, reward and punishment. Even the ancestral heroes are depicted as having human faults and weaknesses.
920 BC to 722 BC - following the death of Solomon (around 920 BC), the kingdom splits in two, Judah in the south with the royal capital at Jerusalem, and Israel/Ephraim in the north with major shrines at Shechem and Bethel. The J-stories primarily reflect the Davidic (southern) point of view. In the north, some stories begin to accumulate twists reflecting the political situation there. The stories from the south stress the importance of Jerusalem, Aaron and the priesthood, and the centralization of sacrifice. Those from the north are about sacrifices conducted anywhere and de-emphasize Aaron in favor of Moses.
The essence of the stories remains the same but the details vary. In the north, the mountain of significance is Horeb, not Sinai, and greater emphasis is placed on Joseph, his mother, and his son Ephraim (one of the largest of the northern tribes). In the southern version, Judah (head of the chief tribe of the south) saves Joseph from being killed by the other brothers; in the northern version, it's Reuben (head of the chief tribe of the north.)
The northern stories--let's call them E-stories--are written down and become the E-document. Northern prophets such as Amos (2:9) and Hosea (12:2-6) use the E-stories in their messages to the people. By the eighth century BC, then, we have two sets of stories, E-versions (northern) and J-versions (southern), both evolved from a single tradition.
722 BC - Israel is conquered by Assyria and the ten tribes of the north are scattered and exiled. Many refugees flee to Judah in the south. Although they are all Israelites, those from the north have somewhat different versions of stories from those in the south. Both texts are viewed as ancient and sacred, so someone combines the two to form a single document, called JE. As they're sitting around hearing the consolidated story read, the people from the north hear familiar phrases and elements and say, yep, that's the story my grandpa told me, all right. The people from the south, ditto. The combined text helps the process of social integration and tribal distinctions disappear.
The JE version subordinates the E-stories to the J-stories, since Judah (the southern kingdom) was politically dominant. Some of the E-stories may have been lost at this time--there aren't separate versions of all the stories. Perhaps in some cases there weren't any differences. Perhaps the southern authors who combined the stories dropped northern variants they couldn't accept. We don't know, and some say the absence of a complete E-document is a weakness in the Documentary theory.
770 BC to 600 BC - A third work appears, mostly concerned with Temple rites, sacrifices, priestly garb, genealogy (focused on the priestly tribe), etc. This is identified as the P-document. The P-stories in all likelihood are very old and handed down from oral tradition. Arguably many of them were compiled as a pro-Aaron response to the anti-Aaron slant of E. Where JE mentions God speaking to Moses, P mentions God speaking to Moses and Aaron. Where JE talks of the staff of Moses, P talks of the staff of Aaron. P accounts for the largest amount of text in the Torah, containing most of the legal sections, rules of sacrifice, genealogies, and priestly matters.
The dating of the P document is hotly debated among Documentary scholars. Some date P as late as Second Temple times (after 580 BC), but we find Friedman's argument compelling, that it appeared in response to JE.
640 BC to 609 BC - Reign of King Josiah. The book of II Kings describes (23:8-13) how a "lost" scroll of Moses was found by Halkiah around 622 BC and read to King Josiah. Most scholars argue (based on internal evidence) that this was the book of Deuteronomy--in fact, this was suggested by the early Church fathers, including Jerome. (Traditionalists usually say the entire written Torah had been lost, the people had strayed so far.) Deuteronomy largely recapitulates the other books, but also contains new material. The Documentary theory labels this last author D, the Deuteronomist.
The content of Deuteronomy is very old, although the literary style seems to be from the later period of Josiah. The D-author, in attributing the writings to Moses himself, certainly felt he was simply reviving Moses' teachings, as understood 600 years later. In much the same way a modern biographer might put together a collection of the sayings of Thomas Jefferson for a modern audience.
So at this point, there are three different texts: JE, P, and D. There were doubtless other texts as well (Genesis makes reference to the "Book of the Wars of the Lord," for example) which are long lost.
587 BC to 536? BC - The southern kingdom of Judah is conquered by Babylon in 587 BC. The people are exiled for 50 years, then return to Jerusalem to rebuild the Temple and restore their religion. There is no longer a king of the line of David, but a high priest. The process is not easy. Other exiled peoples were assimilated by their conquerors and disappeared; the Israelites remained faithful to their homeland and their God. But the religion had been weakened by the exile, and needed to be strengthened and consolidated.
Approximately 450 BC - This is perhaps the most remarkable part of the story, as the Redactor emerges on the scene. He sees the need for religious revival and renewal, for strengthening and centralization. So he combines the three documents (JE, P, and D) into one smooth flowing narrative--the five books of Moses.
The Redactor did lots of cutting and pasting. Genealogies that probably started all together in a P-text were interspersed throughout JE, acting as bridging material or section dividers. Materials that told the same story from pro-Aaron and anti-Aaron viewpoints (for example) were neatly woven together.
The Redactor was respectful of his sources and kept them largely intact. These were all sacred and ancient texts/traditions, so the Redactor presumably didn't drop material--duplication was preferable to omission. Sometimes he combined the different texts; sometimes he left the two stories side by side.
The single document became the center of the Israelite religion, under the prophets Ezra and Nehemiah. Authorship was ascribed to Moses. This wasn't deception. The Redactor in all likelihood knew nothing of the prior 500 year history of authorship and honestly believed the material he was editing had all been handed down from Moses.
From 450 BC on the document was fixed--no more changes. The oldest existing parchments, the Dead Sea scrolls, date from around 100 BC. They're almost word-for-word identical to the versions we have today (although there are occasional transcription errors, most so small they would be noticed only by an experienced scholar).