The D, or Deuteronomist source, is thought to have written most of Deuteronomy and the books of Joshua through Second Kings in the 7th and 6th centuries BCE. This source's legal system was based on the bond of the Israelites to the Covenant or people's commitment to following the Commandments, and this source interpreted bad events as people's failure to follow the Covenant with God. Moses, who received the commandments, was the ultimate political and religious authority. D's source of holiness and purity relied on people's ability to follow laws and morals, for example those given in Deuteronomy, and to avoid worshipping God in places other than Jerusalem. This source spoke often about worshipping Yahweh alone and destroying other forms of worship. D took a moralistic approach and included many long sermons. The central holy area for this source is Mount Horeb and Sinai. This source advocates destruction of the Canaanites and other non-Israelites.
The P, or priestly source, is thought to have written in the 6th century BCE, during the period of exile in Babylon. This source, unlike D, stressed the importance of cultic practice and following laws and rituals. This source rejected the idea of a divinely appointed king and gave political power to the priestly class. The legal system was based on the Levites, or the priestly class, and their temple in Jerusalem. Purity in this source came from following rituals. P also emphasizes the idea of the Israelites as God's chosen people and the importance of avoiding intermarriage with non-Israelites.
In some ways, these sources are incompatible, as D gives ultimate authority to the Covenant and laws, while P gives ultimate authority to the priestly class and rituals. D follows a moralistic approach to religion, while P follows a ritual approach. They both, however, stress Israelites' special bond with God and urge non-assimilation with non-Israelites as well as the importance of the temple in Jerusalem.