Devarim / Deuteronomy 32:1 · Pshat
הַאֲזִינוּ הַשָּׁמַיִם וַאֲדַבֵּרָה וְתִשְׁמַע הָאָרֶץ אִמְרֵי־פִי׃
Give ear, O heavens, and I will speak, and let the earth hear the words of my mouth!
Pshat פְּשָׁט
Why are heaven and earth the witnesses?
A contract is signed before witnesses, so that someone can confirm it later. Before his death Moshe (Moses) calls heaven and earth as witnesses. Why them?
Rashi: Moshe is mortal, while heaven and earth exist forever, and they can always confirm that Israel accepted the covenant. They are also the first to give reward or punishment: rain and harvest. Ramban: by the plain sense Scripture makes witnesses of what stands forever, and by the way of truth these are the heaven and earth of the beginning of creation, which themselves entered the covenant with Israel.
How Rashi and Ramban explain it
Rashi Give ear, O heavens
For I am warning Israel, and you be witnesses to it, for so I told them: you will be witnesses. And the same for "and let the earth hear".
And why did he take heaven and earth as witnesses? Moshe said: I am flesh and blood, tomorrow I die. If Israel say, "We never took the covenant upon ourselves", who will come and refute them? Therefore he took heaven and earth as witnesses, witnesses that exist forever.
Moreover: if they are worthy, the witnesses will come and give them their reward: the vine will give its fruit, the earth will give its produce, and the heavens will give their dew. And if they are guilty, the hand of the witnesses will be upon them first: "and He shut up the heavens so that there is no rain, and the ground does not yield its produce" (Devarim / Deuteronomy 11:17), and after that they will quickly perish at the hands of the nations.
Ramban Give ear, O heavens
By the plain sense the words of Rabbi Avraham are right: Scripture makes witnesses, in every matter, of what exists and stands forever. So too: "Hear, O mountains, the quarrel of the Eternal" (Michah / Micah 6:2), and the stone of Yehoshua (Joshua), for there it is written: "for it has heard" (Yehoshua / Joshua 24:27).
And by the way of truth these are the first heaven and earth, named in the book of Bereshit (Genesis): they will enter into the covenant with Israel. Therefore he said that the heavens should give ear and the earth should hear the terms and how they will be dealt with.
Takeaway
"I call the heavens and the earth to witness against you today" are Moshe's words in the previous chapter (Devarim / Deuteronomy 30:19). These are the witnesses Rashi speaks of.
"And the vine will give its fruit, and the earth will give its produce, and the heavens will give their dew" is the promise of the prophet Zecharyah (Zecharyah / Zechariah 8:12).
"Rabbi Avraham" in Ramban is Ibn Ezra.
The stone of Yehoshua: before his death Yehoshua set up a great stone under the oak and said to the people: "This stone will be a witness for us, for it has heard all the words of the Eternal" (Yehoshua / Joshua 24:26–27).
"The way of truth" in Ramban is the hidden teaching of the Torah.