You see the sun and the Earth are deeply in love but since the sun would burn the Earth and its residents they're a little shy about dating, however each year they get a little closer together because they're a little more comfortable about their relationship ( Look it up they actually do get closer ). The moon feels like the third wheel which is why it moves half an inch away every year.( Also true, google please. ) Ugh dating, it's complicated.
Forreal though it's because in space if you have a big mass, things attract to you. In space cameras you may see an astronaut sticking to their ship or walking on it firmly without an appearence of no gravity because it has mass. While it is a little rare an astronaut can often get a wrench from floating a couple feet away because the astronaut's mass is bigger and can pull a wrench a foot or so closer, so when things reach planetary mass (pretty big) they have a pretty darn strong gravity. This could explain why saturn and jupiter have so many moons, during the theory of the big bang more rocks stuck to it because it's huge. This also explains saturn's rings, huge mass holding it up, but I'm not sure about the rings fact. The sun is much bigger than any of these so as you could imagine has the biggest gravitational pull. Why it makes the plantets spin around it I don't know, but we do get half an inch closer ( Look it up ) every year because the sun gets bigger and bigger before it implodes ( don't worry, millions of years away ) so the increase in mass = increase in pull.
OK here is a question for you. You say the moon is moving farther away from the Earth and the Earth is moving closer to the sun. The Earth is gaining mass from cosmic dust so the gravity is stronger but the moon moves away. The sun gets bigger but looses mass by its nuclear reaction so its getting lighter and the gravity is getting weaker, but the Earth is moving closer.
Why do these two things seem in reverse?