Their a chemical reaction inside their bodies, and the insects flash for two main reasons: mating and feeding.
However, this is unlikely to improve the water quality to such a degree that midges would be reduced.
Fireflies are found all over the world, on every continent except Antarctica—and they are incredibly diverse.