We know that the earth's orbit is gradually becoming closer to the sun, inevitably reaching a stage where it will collide with our star. Why shouldn't the moon behave in the same manner? Why is the moon actually moving away from the pull of the earth every year? I have come to think that it simply has to do with the mass of the earth compared to the mass of the sun. Hence why the moon is moving away from the earth and the earth is moving closer to the sun. But which law do we apply to predict such behaviour? Can Newton's or Einstein's law of gravity mathematically predict this? Could anyone quote the formula involved?