Moths are nocturnal insects, actively mostly at night.
Moths orient their flight paths to the moon. Because the moon is so far away, its angle relative to the moth never changes. Sometimes, however, a moth tries to orient its flight path according to a nearby light. Because light sources on the Earth are much closer than the moon, the moth's angle relative to the light source changes as the moth moves. The result is an erratic flight pattern that sends the moth in a spiral towards the light.