The heavens is often used to express powers of governments while the earth is the populations under them.
For example, long after the heavens and earth were literally established, God uses the same phrase in establishing Israel:
And I have put my words in your mouth and covered you in the shadow of my hand, establishing the heavens
and laying the foundations of the earth, and saying to Zion, ‘You are my people. ’” (Isaiah 51:16, ESV)
Note: This was not clear to me at all until noticing it yesterday argued in depth in a sermon from John Owen entitled THE SHAKING AND TRANSLATING OF HEAVEN AND EARTH. (Owens Works, Volume 8, See page 254)
So the earthquake, disturbing the populace, and the loss of heavenly bodies for their usual public power on display, naturally means and overthrow of government powers under the wrath of God. Of course, erroneously through superstition, pagans would more or less also equate such disturbances to an overthrow of their gods, as these powers were at times associated with the gods directly in Emperor worship or indirectly under their favour.
Although God often works in secret, an overhaul of the entire world in which everyone in a given society lives, implied by such commotion a full public recognition of God's wrath. It is meant to rise above the everyday manifestation of Gods anger against sin and implies a long awaiting magnificent disturbance of all who are secure in their power and commotion among people watching in dismay. Furthermore as powers are usually meant to provide order and blessings from God, the darkness covering these happy lights clearly spells his disfavor and withdrawal of a happy countenance towards the earth.
Regarding why the end of the ages takes the image one step further and describes the moon as turning into blood is curious. It seems as a minimum to indicate a more final and extreme vengeance upon those powers that oppose the Messiah, so that their very light is not just toppled but they are made into blood as they perish absolutely.
It might be taking the image to far, but as the Moon is the light to speak of better things to come during the Day, the loss of the Sun mirrors the loss of gospel light, and the loss of Moon in higher abstraction indicates the loss of the light of the Law. In other words government powers actually exist in support of providing gospel and law, even without having any such intention. If we allow this more abstract image to hover over the obvious more certain image, we can say the Sun does not turn into blood but the moon, because the final judgment will actually be the Law taking vengeance on the sins of the world, while the gospel is no longer offered, for the age of repentance is no more.