Deuteronomy 32 is the “Song” of which Moses spoke in the previous chapter 31. In it, Moses called heaven and earth to bear witness to the calamities that will befall Israel if it sins — and the ultimate joy that will come with the final deliverance.
Deuteronomy 32:1 Listen, O you heavens and I will speak; and hear, O earth, the words of my mouth. C-MATS
Question: Why did יהוה have the heavens and earth to hear His words and testify against them when they sinned? To testify that he was warning Israel, Moses wanted witnesses that would outlive his and later generations; otherwise, who could reproach the Israelites of the future if they were to deny that they had ever accepted the covenant? Therefore Moses appointed heaven and earth, which are eternal. Furthermore, if Israel acts righteously, the witnesses will come and reward them: “For there shall be a seed of peace; the vine shall give its fruit and the ground shall give its increase and the heavens shall give their dew; and I will cause to inherit אֶת־ remnant of this people אֶת־ all these things.” (Zechariah 8:12). And if Israel acts sinfully, the hand of the witnesses will be upon them first [to inflict punishment upon them]: “And then יהוה anger will be aroused against you and He will shut up אֶת־ the heavens, that there will be no rain and that the land will not yield אֶת־ her fruit;” (Deuteronomy 11:17), and then [the verse continues]: “and you will perish quickly from off the good land which יהוה gives you.”-through [the attacks of] the nations. Chumash
Deuteronomy 32:4 He is the Rock, His work is perfect: all His ways are judgments: an Elohim of truth and without iniquity, just and right is He. C-MATS
Question: Is יהוה’s judgment fair to the righteous and the wicked? Even though יהוה is strong like a rock, when He brings judgment upon those who disobey His will, He does not bring it in a flood of anger, but rather with justice because “His work is perfect.” The term perfect refers to the article of faith that the totality of יהוה’s work-the infinite combination of good fortune and failure, happiness and sadness, joy and tragedy-is harmonious whole, even though human intelligence is incapable of understanding how all the pieces of יהוה’s puzzle fit together. He is faithful to reward the righteous their due in the world-to-come. And even though He defers their reward, in the end He will fulfill His words. Even to the wicked; יהוה rewards them in this world for any righteous deeds they might have performed. Chumash