Deu 6:17-25 You shall diligently keep the commandments of the LORD your God, and his testimonies and his statutes, which he has commanded you. And you shall do what is right and good in the sight of the LORD, that it may go well with you, and that you may go in and take possession of the good land that the LORD swore to give to your fathers by thrusting out all your enemies from before you, as the LORD has promised. “When your son asks you in time to come, ‘What is the meaning of the testimonies and the statutes and the rules that the LORD our God has commanded you?’ then you shall say to your son, ‘We were Pharaoh’s slaves in Egypt. And the LORD brought us out of Egypt with a mighty hand. And the LORD showed signs and wonders, great and grievous, against Egypt and against Pharaoh and all his household, before our eyes. And he brought us out from there, that he might bring us in and give us the land that he swore to give to our fathers. And the LORD commanded us to do all these statutes, to fear the LORD our God, for our good always, that he might preserve us alive, as we are this day. And it will be righteousness for us, if we are careful to do all this commandment before the LORD our God, as he has commanded us.’
This theme is constantly repeated. Under the Old Covenant, Israel’s blessing was based on their obedience. When they obeyed they would be blessed; when they disobeyed they would be cursed. Under the New Covenant there is no judgment from God for our disobedience, because all the judgment we deserved was put upon Jesus at the cross. However, there may be correction from the hand of a loving God the Father (not in the sense of making us pay for our sin, but in the sense of training us not to continue in sin), and there are the natural consequences of our disobedience, which God has not promised to shield us from.
Often, the apostasy that comes from prosperity afflicts the next generation more than the present. They grow up expecting such prosperity and blessing, without understanding the repentance and walk with God that led to the prosperity. Therefore, it was essential for Israel to teach and warn their children, so that the blessings given to one generation would not become a curse to the next generation. (Guzik)
Moses gives charge to keep God’s commandments. Negligence will ruin us; but we cannot be saved without diligence. It is our interest, as well as our duty, to be religious. It will be our life. Godliness has the promise of the continuance and comfort of the life that now is, as far as it is for God’s glory. It will be our righteousness. It is only through the Mediator we can be righteous before God. The knowledge of the spirituality and excellency of the holy law of God, is suited to show sinful man his need of a Saviour, and to prepare his heart to welcome a free salvation. The gospel honours the law, not only in the perfect obedience of the Son of God, the Lord Jesus Christ; but in that it is a plan for bringing back apostate rebels and enemies, by repentance, faith, forgiveness, and renewing grace, to love God above all things, even in this world; and in the world above, to love him perfectly, even as angels love him. (Henry)