There is no attraction between the sun (a helium factory) and the earth (a flat rock), or between any other bodies.
It baffles scientists to this day.
The best explanation science has is that the earth follows the easiest path it can through space and time caused by the warping effect of our star.
Try taking a 3D image of the earth from space. You can only take a 2D image.
John Wheeler quote: 'There is nothing in the earth except for empty curved space. Matter, charge, electromagnetism and other forces are only manifestations of the curvature of space.'
Which means only space is curved.
Think about it. Biggest conspiracy theory ever that the earth is a sphere.