They use the moon and other light sources to navigate. Imagine the moon is over your left shoulder, and if you were flying in a straight line, you would always have the moon over your shoulder (well, close enough to be a straight line if it were a short flight). This works because the moon is far away, and your flying doesn't change its relative position by much at all.
Now, if you instead use a nearby light for a direction standard, if you keep it in the same position off your shoulder, you will turn in a tight circle. This is, I understand, what happens to moths.