Illustration of retrograde motion. The top panel shows the apparent position of Jupiter against the night sky, as seen from the Earth, during a retrograde event. The bottom panel shows the sight lines from the Earth to Jupiter at different points in the orbits of the two planets. As can be seen, Jupiter does not in fact move backward at any time. It appears to do so as seen from the Earth because the Earth is moving faster than Jupiter and passes it. The effect is exactly similar to passing a car on the expressway and watching it move "backward" as you go by.
The retrograde motion of the planets was impossible to explain using a model of perfect spheres centered on the Earth, so epicycles and other embellishments were added to the Earth-centered model of the Universe to fix it.