Appearance, Reality, and Orbital Mechanics
LOOKS LIKE A MOON, BUT ISN’T
 HORSESHOE ORBITS. A small sun-orbiting body can appear to be in this kind of orbit when viewed from a larger sun-orbiting body [such as Earth] as long as they take the same amount of time to make their orbits.
This graphic shows possible such orbits along gravitational contours. The Earth (and the whole image with it) is rotating counterclockwise around the Sun.
(Horseshoe orbit - Wikipedia)
There is a nearby astronomical object – an asteroid in solar orbit of the type technically called a minor planet – called 3753 Cruithne. Its orbit is in a kind of resonance with that of Earth.
Looking at Cruithne from Earth, it appears to describe a bean-shaped orbit that is more or less a horseshoe. And from our short-term, Earth-based vantage point, it might appear to be, and has been called, a second moon. However, it’s not in orbit around Earth; it orbits the sun.
 ORBITS of EARTH and CRUITHNE. Cruithne and Earth both orbit around the sun. They seem to follow each other because of the 1:1 orbital resonance. Clearly Cruithne isn’t a moon of Earth. In fact, sometimes it’s on the other side of the sun.
 THE APPARENT ORBIT OF CRUITHNE. From our perspective on Earth, Cruithne appears to be in a bean-shaped orbit. The animation shows why. You can also see that although Earth and Cruithne each have a one year orbit around the sun, Cruithne’s apparent horseshoe orbit around the Earth takes much longer (770 years, in fact).