But first one basic rule before going to these "freaks" of orbital mechanics.
Orbital periods and speeds of objects depend (only) on size of the orbit, in smaller orbit object moves always faster and in larger orbit it moves
slower. That's why Mercury orbits around with much faster speed than Venus, Venus faster than Earth... and same continues with moons of those planets
with multiple moons.
Now there's two moons of Saturn, Epimetheus and Janus which are in orbits whose difference is smaller than diameters of these moons. So how those two
moons can have almost same orbit without moon in faster inner orbit "driving to the rear" of moon in slower outer orbit?
Well, let's take a look at situation where moon in faster inner orbit is approaching moon in slower outer orbit. (which happens every 3.5 years)
Interaction of gravities causes outer moon to loose some of its orbital energy dropping it to "lower" but faster inner orbit while energy it lost is
"transferred" to moon in inner orbit which now speeds up and rises to "higher" but slower outer orbit. Moon originally in outer orbit is now in
faster inner orbit speeding away from moon which first caught it up and is now in slower outer orbit. After 3.5 years same thing happens again when
new inner moon catchs up new outer moon.
So where does this horseshoe
orbit come from and what is it?
Let's take previous objects as example and imagine coordinate frame co-rotating with one of these moons so that Saturn is fixed in the center of
frame and our "reference" moon is fixed in right side. Also before starting this "simulation" we assume that this reference moon is in inner orbit
at first and other moon is on otherside of planet moving clockwise.
Now it looks like other moon is moving in its orbit towards front of our reference moon, but when it arrives to front of our moon it stops and starts
moving away, literally going "backwards" in its orbit around planet until it's behind our moon where it stops and changes direction again starting
to move clockwise again etc... essentially moving in open orbit looking like horseshoe. (this situation would look entirely same also in frame
co-rotating with other moon)
Also Earth has object, one Near Earth Asteroid, in this kind "orbit": 3753 Cruithne, which wasn't kept anyway special asteroid until few
astronomers studied its orbit and noticed this phenomenon. (actually horseshoe it makes is much more complicated than example)
Basic situation is similar to the case of Saturn's moons in that it's interaction of Earth's and asteroid's gravity which in turn either kicks
Cruithne to higher and slower orbit where it starts lagging behind Earth or pulls it to lower and faster orbit when Earth is reaching it.
Change in Earth's orbit caused by these energy transfers is insignificant because of huge difference in mass.
There's one peculiarity more among orbits: quasi-satellite
Quasi-satellite is object ("moon") which orbits sun but when viewed from planet in "equally long" orbit it looks to be making funny looking oblong
loop around this planet.
So how that is possible?
Orbit of object takes equal amount of time as "its" planet and this orbit is synchronized/clocked on to orbit of planet meaning they're both always
near each others. But because eccentrities (and/or inclination) of orbits are different other one of them goes closer and farther from sun than other,
that with different variation in speed is what makes it look like it's orbiting planet in weird orbit. (even though its orbit is ruled by sun's
Earth also had asteroid in this kind "orbit"...
Notice "had", that's because object is not anymore in quasi-satellite satellite orbit but in horseshoe orbit, this asteroid is actually alternating
between horseshoe and quasi-satellite orbits!