Why do planets sometimes go backwards?

When the Earth overtakes an outer planet, it seems to drift backwards for a few weeks.

Why Mars seems to go backwardsseen from above1234567891011seen from Earth, against the stars
Left, from above: the Earth (blue) on its faster inner orbit overtakes Mars (red); the lines show where we see Mars at eleven moments a few weeks apart. Right, what we see: Mars moves along among the stars, stops, goes backwards while we pass it (4 → 8), stops again and carries on.

It's like passing a slower car on a motorway: for a moment the other car seems to move backwards against the distant hills.

See it live, in 3D

Related questions