Deuteronomy is the basis of Judaism and is distinct from the other Mosaic texts of Exodus, Leviticus, and Numbers because it has more emphasis on "loving" God and includes the beginnings of constitutionalism, which means deference to the law because it reflects the unchanging principles of God. The theology of Deuteronomy is that the Israelites will know whether He favors them based on whether they've kept His law. This is a significant step beyond the theology of Numbers, which seems based more on trial and error as it tells horrible stories of how God took revenge on the nation in unpredictable ways. In Deuteronomic theology, people don't discern His will by trial and error, because the law already has been recorded, so people can know His will from generation to generation without having to rely as much on oral recollection and standing stones. (Standing stones were monuments for recalling what a place's supernatural significance is: how God did some miracle at that place, and why.) While faith is based on recalling events based on the name origins of locations in the Book of Joshua, Deuteronomy seeks to establish people's faith based on divine moral principles, and the potential advantages and disadvantages to each individual.
There is something remarkable about Deuteronomy 32:30: "How could one chase a thousand, and two put ten thousand to flight, unless their Rock had sold them, and the Lord had given them up?" In the context, the Israelites are militarily superior but still are defeated by their enemies. Even when Israel has the military advantage, they will lose, unless they are obeying the covenant God gave to them. It is somewhat inspiring to read this, because it shows a lot of faith that they can defeat enemies when they're outnumbered, and that they can lose when it seems like they have the military advantage, all dependent on whether God favors them. I don't so much admire their belief that God dictates the outcome, because religious belief in something to explain outcomes is a natural "crutch" our minds have, but I admire how they don't trust in their own military power because they believe God's moral principles are of greater worth than military power. Ecclesiastes 9:18a says "Wisdom is better than weapons of war." The roots of this are in Deuteronomy's understanding of God blessing or cursing the nation in accordance with whether they keep His law (synonymous with covenant). The potential positive outcome is given in a hyperbolic way (poetically exaggerated) in Leviticus 26:7-8 (a chapter of blessings and curses similar to Deuteronomy 28): "But you will chase your enemies and they will fall before you by the sword; five of you will chase a hundred, and a hundred of you will chase ten thousand, and your enemies will fall before you by the sword."
By the time Deuteronomy was in its final form, the Israelites understand the importance of discerning God's character through moral laws, instead of just trial and error ("This bad outcome happened, and so God must've been angry with me for some reason I'll have to figure out"). From that point on, the debate becomes more about the meaning and relevance of the law instead of its origin. The Bible doesn't record any major debate in the monarchial period about whether God had created the Mosaic Law. The people's moral compromise was severe in that they got into child sacrifice and sexual licentiousness with the cult of Baal-Asherah. There was plenty in the Mosaic Law which the prophets could refer to for calling the people to holiness, without having to delve into the origin — whether it was written by Moses and whether its narrative could be trusted, etc. Jumping ahead to the 1800's, the American people had no questions about whether the Founding Fathers really believed the Declaration of Independence. Their debates prior to the Civil War were about how the Founders viewed "Negroes" with reference to the Declaration's ideals, and whether the Founders' views were even relevant to an "enlightened" society which recognized the God-given inferiority of black people. This demonstrates that even when the historical origin of a nation's founding creed is undisputed, people will still reject the law because of their sin. The Declaration of Independence has a clear historical orientation to time and place and people. It is based on Jesus' teachings that every individual matters, that leaders are to be servants, and that no people group, age group, or gender is inherently better than another. The Mosaic covenant is great if you stick with the 10 Commandments and the blessings and curses on the nation in Deuteronomy, but dangerous if you venture beyond that in establishing universal moral principles.
Deuteronomic theology is a double-edged sword (which means it has potential good and bad uses) because it teaches those who trust in God and make good choices that God favors them, sometimes even supernaturally assisting them, and that the wicked will be held accountable — the basis of the Book of Proverbs and the broad condemnations of other nations in the Books of the Prophets. In hindsight, we can see the prophets' condemnations of other nations came true, because none of them exist today like they once did except for the Jews! But Deuteronomic theology can be misused as an easy explanation of why something good or bad happened. The reality is that God does not operate according to karma, rewards for good deeds and punishments for bad deeds, and Jesus' atonement nullifies the whole concept because He forgives those who see they need Him, while rejecting those who believe they can earn His favor on their own merit. When the disciples ask Jesus at the beginning of John 9 whether the man was born blind because of his own sin or his parents' sin, they aren't referring to reincarnation, which is not taught in Judaism, but they are taking karma to its full extent: Someone must've done something wrong which led to this negative outcome! But the blame game is not healthy, because you can always attribute a bad outcome to someone — even if in the case of the blind man, you'd blame it on Adam and Eve who messed up the whole world — but it doesn't fix the problem. You can't answer the three big questions of causation, contradiction, and responsibility: Why the first man and woman sinned and led to a curse on the world, why God seems good in ways but doesn't intervene when we think He ought to, and who's to blame — how much a person is individually responsible for choices when most of a person's essence is shaped by outside influences or inherited genetic factors. And it doesn't matter ultimately, because even Jesus couldn't make sure everyone would be saved, but He did everything He could do, and then entrusted the job (the "keys to the kingdom", Matthew 16:19) to His disciples. We are indebted to them because we still have His Word 2000 years later, even though evil forces in the world tried to stop it.
The broad themes of justice and rewards and punishments are good in the Old Testament, but the Book of Job directly challenges Deuteronomic theology and shows us that peace can only come through recognizing our need for a Savior, and is the only Old Testament book to understand that God would have to provide a mediator from heaven to atone for Job's perceived sin. Job 16:21 shows a clear understanding of the future Gospel of Christ: "O that a man might plead with God [on behalf of my sin] as a man with his neighbor!" Therefore, Deuteronomic theology has some things to learn from, but shouldn't be viewed as a guarantee any more than Proverbs 22:6's "Train up a child in the way he should go, and even when he is old he will not depart from it." That obviously did not apply to Judas Iscariot, one of Jesus' disciples! Ecclesiastes sees the same injustice which the Book of Job explores, directly challenging the claims of the proverbs, and takes the approach of skepticism about whether there is any life after death or ultimate justice. We don't have to rely on wishful thinking about ultimate justice after death, because we have the evidence of many predictive prophecies about Jesus Christ to give us confidence that He will resurrect all who belong to Him.