The term "heaven and earth" or the individual words "heaven" and "earth" are used in a variety of different ways in the bible. We need to allow context to drive the meaning. We cannot force the same meaning upon the words in every instance. The bible can be tricky in this regard but this is why we let scripture help us out. We let scripture interpret scripture.
"Heaven and Earth" was the establishment of an order. A new order. A new Covenant. The term can also be used to represent God's Covenant people. It can also be used to represent how God interacted with that people and through which means He Covenanted with them. For instance, the Law. Take this passage for an example...
"When you beget children and grandchildren and have grown old in the land, and act corruptly and make a carved image in the form of anything, and do evil in the sight of the Lord your God to provoke Him to anger, I call HEAVEN AND EARTH to witness against you this day" Deut. 4:25-26
Clearly this is NOT Moses calling literal heaven and literal earth as in the mountains and trees to witness against the Israelites. Clearly this is Moses calling the Law to witness against the children of Israel because of their Idolatry. The Law said, "you shall have no idols".
I am going to list a few examples of how Moses addresses the assembly of the house of Israel in Deuteronomy. I won't list them all because there are more but check these out...
"And Moses called all Israel, and said to them: “HEAR, O ISRAEL, the statutes and judgments which I speak" Deut. 5:1
“HEAR, O, ISRAEL: The Lord our God, the Lord is one" Deut. 6:4
“HEAR, O ISRAEL: You are to cross over the Jordan today" Deut. 9:1
So Moses continually calls out to the people of Israel and begins it with "HEAR, O ISRAEL!"
He does this much more too but look at how he changes it up in Deuteronomy 31-32...
"Then Moses spoke in the hearing of all the assembly of Israel the words of this song until they were ended: “GIVE EAR, O HEAVENS and I will speak; AND HEAR, O EARTH, the words of my mouth" Deut. 31:30-32:1
Moses still speaking to the exact same people (Israel) and he refers to them the exact same way "HEAR!" But yet this time he calls them "Heaven and earth".
They were the people (Earth) with whom God (Heaven) communed with and dwelt among.
So the "Heaven & Earth" can mean a few things but it ALWAYS involves the order that God created back in Genesis. The things it can mean are:
-The order itself (the Covenant arrangement)
-The people of that order themselves (the people of that Covenant)
-The Law of that order (that which witnessed against the people of that Covenant)
Now doesn't Genesis 2:4 make much more sense now? It reads...
"These are the generations of the heavens and the earth when they were created"
And immediately after that statement we see Adam formed. Then we get to Abel. Then Seth. And then we continue on through the "generations" of that Old Order. We continue on learning the story of all the people (generations) who made up that entire Old Heaven and Earth.
Thanks for reading this short study guys. If you've enjoyed it please give it a like below and feel free to share as well.