When Sun and Earth are moving, at each moment $t$ they are attracted not to the current position of each other, but to the position of each other at $t-\Delta t$, where $\Delta t$ is the time required for gravity to propagate the distance between each other. Laplace computed the effect of this "retardation" on their orbits and concluded, based on Newtonian mechanics, that unless the speed of gravity is $~10^9$ faster than the speed of light Earth would have fallen into the Sun already.
Now we have a more sophisticated theory of gravity by Einstein and others. This theory has two properties of interest for this question: it is well approximated by the Newtonian mechanics, at least on Earth-Sun scale of masses and distances, and it assumes that the speed of gravity is finite, equal to or at least on the order of magnitude of the speed of light.
The above raises the title question: why didn't Earth fell into the Sun, as Laplace has computed?