It's quite a beautiful sight. Magical. Though these are named Glow Worms, they are not worms at all. They are larvae of gnats, an insect that looks like a mosquito.
They are bioluminescent, - emit light naturally from an organ near their tails. The bioluminescence is created through a reaction of an enzyme called luciferase with oxygen and a variety of other chemicals.
There are two main cave systems in Waitomo (North Island) and Te Anau (South Island). The species of these glow worms are "Arachnocampa luminosa"