The reason is the inherent speed of the Earth. And the Earth’s speed is sideways as compared to that of the Sun. So the Earth is under the influence of sideways momentum. The speed is actually 67,000 miles per hour. 30 kilometres every second. But this remains balanced due to this sideways momentum. Without this, the Earth would have collided with the Sun.
In the same way, there is a Supermassive Black Hole at the center of the Milky Way, with a huge gravitational pull, due to which the Sun is revolving around the Milky Way Galaxy. Next, you may wonder why does the Moon revolve around the Earth? And why not around the Sun?
But think about this once, The moon isn’t revolving only around the Earth. Since the Earth is revolving around the Sun, The Moon is revolving the Sun too. The only difference is that it has a spiral orbital path. So in the midst of these revolutions, sometimes, the three objects get into a straight line. If in this straight line, the Earth is the one in the middle, Earth’s shadow falls on the moon, and we call it a lunar eclipse.