If you were to stumble into New Zealand’s Waitomo cave, you’d probably wonder who hung up all of the pretty blue Christmas lights. But on closer inspection, you’d find that they aren’t lights at all... hello, worms!

Waitomo cave is home to thousands of carnivorous, bioluminescent worms that hang from the walls and ceiling, creating one of the weirdest and most beautiful displays nature has to offer.

The cave was first discovered in 1887 by English surveyor Fred Mace and Maori chief Tane Tinorau, who rafted into the Waitomo while exploring the area around it.

Once inside, they were confused by the weird blue dots scattered over all of the rocks, making the cave look more like a planetarium than anything else. What the duo didn’t know was that they were looking at a type of glow worm known as Arachnocampa luminosa ­- commonly known as glowing spider-worms' - that were trying to catch prey by illuminating the cave.

These remarkably bright worms - which emit light by breaking down proteins - will eventually become gnats, but becoming a gnat is hard work and requires a lot of energy. Luckily for the worms, Waitomo cave is filled with small flying insects that hatch from the stream at its base.

These ill-fated insects are attracted to the blue light of the worms, which they think is starlight. The worms then set webs of tiny strings to catch the insects in as they fly towards them, providing them with an almost endless buffet.

In other words, the worms are able to mimic the cosmos so well that insects get confused and end up flying straight into the trap (hence the 'spider' part of their common name).

Elliot Kennseron explains the whole process with great detail in a report for KQED:

"When potential prey touches a snare, the worm hangs back while its next meal struggles, becoming entangled in the gooey threads. Scientists who’ve analysed the mucous haven’t found any toxins in it, but suspect it may clog the breathing holes of insects fighting to get free. Once the victim grows still, it’s time to reel in the catch. The worm hangs out of its hammock and pulls up the thread the same way it went down: through its mouth. Those mucous balls also absorb water from the damp air in the cave. The worm is hydrating with every glob it swallows."

The worms stay in this larval stage for about a year, dying only a few short weeks after becoming adult gnats.

Of course, the worms of Waitomo cave are not the only insects that utilise bioluminescence. One of the best examples is the firefly, which use chemicals to produce light flashes for a bunch of different tasks from staying safe in the larval stage to attracting mates when fully matured.

Also, earlier this year, researchers from the US found a glowing hawksbill sea turtle near the Solomon Islands, representing the first ever bioluminescent reptile that we know of.

Check out the video above to see the glow worms in action - it’s truly a sight worth seeing for both its beauty and carnage.