(This post is basically a compilation of various sources)
While tradition asserts that Moses was the author of the Torah (or Pentateuch), modern scholarship sees at least four different authors: JEDP. “J” stands for “Jahwist” or “Yahwist”, the author from the southern kingdom of Judah who prefers to write the Four Letters YHWH. “E” stands for “Elohist” and is from the northern kingdom of Israel. This author prefers the more generic Canaanite term for god “El” or “Elohim”. “D” stands for “Deuteronomist”; a reformist from king Josiah’s (or Josiah himself) court. “P” stands for “Priestly”, a writer who focuses on authentic priestly duties and lineage; sacrifices to YHWH or El could only be done by a priest from the tribe of Aaron, Moses’ brother. Thus any priestly duties occurring before the covenant on Sinai — like the enigmatic Melkitsedek (or Melchizedek) in Genesis 14 — would not have been written by P. There are actually arguments that Genesis 14 wasn’t written by any of the four streams due to the strange name. Melkitsedek can be liberally translated as “my righteous king”; Melkitsedek is both a king and a priest. This doesn’t happen in the history of Israel and Judah until Maccabean times (c. 150 BCE).
In P, only priests in the lineage of Aaron are people with access/communication to God. There are no angelic visitations, dreams, talking animals, or anything else like that. All the other sources include God communicating with people via these means. E and D both repeatedly refer to prophets and prophesy. Neither P nor J ever does (P uses the word once – metaphorically – to refer to Aaron himself). P never mentions judges – only allowing Aaronid priests to mediate. P also does not classify non-Aaronid Levites as priests, and only allows the Aaronids to have access to the Urim and Tummim. P only allows atonement for sins via sacrifices brought to Aaronid priests. In short, in P sources, the Aaronid priests and only the Aaronid priests have access to God. In D, on the other hand, all Levites are considered priests.
In P, as mentioned, the only contact with God is through priests. God never appears in person. He is never referred to as merciful or kind – indeed, the words “mercy”, “kindness”, “grace” and “repentance” are never used in P. The God described in P is implacable and all stories about him refer only to his wrath and justice; never to positive character traits. All the stories with positive (and more human) character traits of God are in J and E. In J, on the other hand, God makes frequent personal appearances. He walks in the garden in Eden, personally makes Adam and Eve’s clothes, personally closes the door of the Ark, and so on. In E as well, God wrestles with Jacob and appears personally to Moses. In P, on the other hand, God never makes a personal appearance.
J and P both refer to Mount Sinai repeatedly. E and D refer to it as Mount Horeb. There are no exceptions to this.
J and E range from 700-622 BCE, D to 622 BCE, P from 587-539 BCE, and the joining up done sometime around 450 BCE (although there is a good argument to suggest that tinkering with the text continued well into Hellenistic times). It is important to remember that nothing in the Torah (well… there are some poems like the Song of Miriam) is as old as Homer. These four authors also did not come from a vacuum, their theology was formed from pre-existing Canaanite theology and pantheon. Along with El (Elyon, or “El Most High”) and YHWH, the Canaanite pantheon included YHWH’s wife Asarah (or Asherah), Baal, Chemosh, Shalim, Shachar (“shachar” means “dawn”, and appears in Isaiah 14:12 [“dawn”]; the taunt song in Isaiah 14 is an old Canaanite song), and many others.
Basically, J and E were written independently, telling the same stories with slightly different emphases. At some point these were edited together into a single JE document. Some time after the writing of the first documents, a P document was written – telling the same stories but with a very different theological basis. Some time later still, a D document was written telling the more recent history of Judah and Israel, and claiming that they were once a unified kingdom, which fits with the period after the Assyrian conquest of Israel c. 720 BCE and the archaeological emergence of Judah due to Israelite refugees fleeing south. The tensions between the two nations before Assyrian conquest was apparent in such places as Isaiah 7:10-16. At some point after this, all four documents were edited together into a single document that became the Torah we know.
This might seem contrary to what’s taught in Sunday School, but just like most religions, there’s a separation between the religion practiced by the common people and the religion practiced by the priests. Analogous to modern times, there’s a huge gulf between the Christianity learned and taught by seminaries and Biblical scholars (“scholarly” Christianity) and the common person’s Christianity (“popular” Christianity). The same sociological context was extant in ancient Israel and Judah. Popular Judaism of ancient I&J was more polytheistic, acknowledging YHWH and his wife Asarah whereas the priestly Judaism of ancient I&J leaned more towards henotheism or monolatry. Of course, the priests controlled the texts since they were the ones writing them and eventually Priestly Judaism won out. Hence all of the Asarah bashing by D and P; archaeology shows a lot of veneration of Asarah by the common people.
If we look at all the J texts, they are consistent in that people started to call God YHWH right from the beginning (Gen 4:1 and Gen 4:26). The P and E texts, however, are both consistent in that people only started to call God YHWH when he revealed his name to Moses (Ex 6:2-3). Additionally, whilst the J author does call God Elohim, he only ever does this whilst narrating events – he never has a character refer to God as Elohim.
The letters from Elephantine show that both the Judean and Samaritan (capitol of the northern kingdom of Israel) temples coexisted. The Elephantine letters also strongly suggest that the holiday of passover was started during or after the Babylonian exile.
A recent carbon-dating of materials that come from a specifically locations in Israel (Megiddo K6 and Lachish VI — the numbers indicate strata) provides an uncalibrated dating range of 1194-1114 BCE. The Philistine pottery at those sites at those levels date early Philistine presence to that time. [I. Finkelstein & E. Piasetsky, “Radiocarbon Dating and Philistine Chronology”, Egypt and Levant XVII, ed M. Bietak, Vienna 2007]
A reading of Judges doesn’t know anything about the arrival of the Philistines on the Levantine coast. In fact, in Genesis the Philistines are already in the Levant at the time of Abraham and Isaac. The arrival of the Philistines was such a serious event in the area that soon after that time the Egyptians had lost control of the coastal area and later the uplands as well.
The bible knows nothing about the arrival of the Philistines, yet if a culture was there at the time they couldn’t miss such a presence. I’d have to conclude that there was no maintained tradition that reached back as far as the arrival of the Philistines, for if there had been, you’d expect the bang to be recorded. Instead, you have the local population (without sign of a recent arrival of its own) becoming aware of the Philistines as its awareness spread beyond its little world around Jerusalem and then the wider uplands area.
This suggests that this group of people as a cultural entity doesn’t go back as far as the arrival of the Philistines. (This seems to match the linguistic evidence that the Phoenicians were the earliest separation from the Canaanite group of languages and Hebrew was a later, more conservative split.)