(Genesis 1:2) And the earth was formlessness. Now since Scripture opened with the heaven first, what is the reason it explains the matters of the earth first? A parable: to what is the matter comparable? To a king of flesh and blood who said to his servants, Rise early and come to my gate. He rose early and found men and women there. Whom does he praise? The one whose custom it is not to rise early, and yet rose early.
Why Scripture Explains the Earth Before the Heaven
Yalkut Shimoni on Torah 4:7
(בראשית א ב) וְהָאָרֶץ הָיְתָה תֹהוּ, מִכְדֵי בַּשָּׁמַיִם פָּתַח בְּרֵישָׁא מַאי טַעְמָא מְפָרֵשׁ מִילֵי דְּאֶרֶץ בְּרֵישָׁא. מָשָׁל לְמָה הַדָּבָר דּוֹמֶה, לְמֶלֶךְ בָּשָׂר וָדָם שֶּׁאָמַר לַעֲבָדָיו תַּשְׁכִּימוּ לְפִתְחִי, הִשְׁכִּים וּמָצָא אֲנָשִׁים וְנָשִׁים לְמִי מְשַׁבֵּחַ לְמִי שֶׁאֵין דַּרְכּוֹ לְהַשְׁכִּים וְהִשְׁכִּים.