There is a lot going on in Deuteronomy 7:12-26. Moses is speaking on behalf of God about many things. "Do not bring a detestable thing into your house. The LORD your God will deliver them other nations to you. The LORD your God will completely get rid of your enemies. The Lord your God has performed miraculous signs and wonders in the past and will use that same power to overcome those who you fear. Do not look on the people you destroy with pity the LORD your God is giving them over to you. The LORD will keep you free from every disease. The LORD your God will bless you, increase your numbers, and love you. The LORD your God will keep his covenant of love with you, as he swore to your forefathers."
After reading all these prohibitions and promises, I wondered, what is God's point? What benefit would the Israelites have in recording these words as a part of their canon? My conclusion is that this passage served as a clear warning to the Israelites before they sinned. But more importantly, after they sinned, and were punished, and were restored, they could reflect on this passage and realize, "God knows."
He knows exactly what is in the hearts of the Israelites. He knows exactly what temptations they are about to face. He knows that His people will start to doubt His love. He knows that His people will start to not pay attention to the laws given.
Often times, I am blessed by God's word as I'm listening to a message from our pastor or from doing QT. I can feel God giving me guidance and warnings and promises about my future. But the most encouraging moments with scripture often come when I look back on my life. I realize through meditating on the passage that God knew what was in my heart and knew what I would do even before I did.
That makes me feel more fully loved. He knows us completely, and knows how spiritually immature we are. He spends time talking to us, and invests in us, not because He has overestimated our potential but because He knows we are needy and loves us anyway.