When it gets close, the car again switches to the outer lane and slows down. Then the whole cycle repeats. This is what is happening in a simple horseshoe. Both vehicles share the same highway, but in a coordinated fashion so as to avoid collision. In reality, the delicate coordination of the asteroid and the Earth is performed by the laws of celestial mechanics, and requires just the right conditions.
Horseshoes can be more complicated than that shown above.
Though no examples have been known in nature before now, theoretical studies had shown that spiraling horseshoes, like that in the cartoon shown below, are also possible. Though more complicated, the car still alternates between catching up with and falling behind the truck. Cruithne is on an spiraling horseshoe orbit, similar to the one sketched above, but its behaviour is even stranger. Secondly, one part of the horseshoe actually overlaps the position of the Earth when viewed from above. Note again that Cruithne's horseshoe is composed of tightly wound kidney-bean shaped spirals which are almost impossible to distinguish individually in the picture.