What you're likely thinking of is the apparent retrograde motion of planets. This is an optical illusion that happens because Earth and other planets are moving at different speeds in their orbits.
Here's how it works:
1. Earth overtakes a slower-moving planet: As Earth catches up to a slower-moving planet like Mars, the planet seems to slow down, stop, and then move backwards in the sky for a short period.
2. The illusion: This is because we're observing the planet from a moving frame of reference (Earth). It's like when you're driving on a highway and pass a slower car. For a moment, the car seems to be moving backwards relative to you.
So, no planet actually moves backwards around the sun, it's just an illusion caused by our perspective from Earth.