It is unclear why flying insects congregate around artificial light sources. Here, the authors use high-speed videography and motion-capture, finding that insects fly perpendicular to light sources due to a disruption of the dorsal light response.
Preexisting research into bugs circling lights was mainly to see what properties of the lights attracted the bugs, which is how we know that certain LED lights can prevent the bugs from flying towards it.
This study, however, showed that the bugs aren't trying to get to the light at all. The light triggers their dorsal reflex, causing them to recalibrate their sense of direction to keep the light at a fixed angle from their perspective. The bugs think they are going in a straight line, forever, and they never get to where they are going.
The light triggers their dorsal reflex, causing them to recalibrate their sense of direction to keep the light at a fixed angle from their perspective. The bugs think they are going in a straight line, forever, and they never get to where they are going.