The force of gravity is not instantaneous. It "travels" at the speed of light. The Earth is not attracted to where the Sun is "now", it is attracted to where the Sun was approx. 8 minutes ago (the length of time it takes for light to travel from the Sun to the Earth), and vice versa.