A glowworm nest surrounded by the sticky lines that help it catch flying and crawling critters.

Baby glowworms could be the interior designers of the cave world, if it weren't for their morbid machinations. These developing worms sit inside a tube of mucus on cave ceilings, sending out a curtain of sticky threads that look like sparkling beaded necklaces.

The purpose of the dazzling threads, rather than to enchant cave homes, is to trap unsuspecting insects. And now, researchers think they may have found the secret ingredient in the worms' traps: urea from their guts.

The urea allows moisture in the humid cave to form droplets on the glowworms' secreted threads, the researchers found. These sticky, watery droplets trap insects drawn toward the blue-green light produced by the glowworms, the researchers said. [Gallery: Eye-Catching Bioluminescent Wonders]

It's about time scientists solved this sticky mystery, said study co-lead researcher Janek von Byern, a postdoctoral fellow at the Institute of Zoology at the University of Vienna and the Ludwig Boltzmann Institute for Experimental and Clinical Traumatology in Austria.

"For 100 years, everyone looked at the [glowworm's] light organ, but nobody looked at the mouth part, where the glue is produced," von Byern told Live Science.

Von Byern began studying glowworms after watching "Life in the Undergrowth," a BBC documentary written and narrated by naturalist Sir David Attenborough. In the documentary, Attenborough explains how the glowworms meticulously cast out long, sticky silk strings that researchers call fishing lines.

But Attenborough didn't mention what made these lines sticky, so von Byern decided to travel to New Zealand to investigate, he said.

Glowing worms

Glowworms (Arachnocampa) aren't actually worms, but rather the larval form of a fungus gnat, von Byern and his colleagues wrote in the study. The critters stay in the larval stage for about nine months, and then have about two days to mate before they die, von Byern said.

During the larval stage, the glowworms create a nest, first by making a mucous tube that measures up to 16 inches (40 centimeters) long, which is where the glowing larva resides, and then by suspending a curtain of sticky threads — some as long as 20 inches (50 cm) — from it, von Byern said.

These sticky threads catch flying insects — such as moths, mayflies and sand flies — and crawling critters, including ants and millipedes, and even small land snails, von Byern said. Once the prey is trapped in the sticky silk, the glowworm hauls up the thread with its mouthparts, chows down on the meal and tidies up its nest, keeping the fishing lines clean for future prey.

In the past, researchers assumed that glowworms used oxalic acid (a chemical often found in plants such as spinach leaves) to poison their prey, but past research proved that idea wrong, von Byern said. Rather than poison their prey, the larvae trap it.

Sticky trap

To learn more about the fishing lines, von Byern and his colleagues — including study co-lead researcher Victoria Dorrer, a master's student at the Institute of Chemical Technologies and Analytics in Austria — collected more than 4,000 glowworm threads from two caves on New Zealand's North Island.

The task was fairly tricky, as the lines are about 99 percent water and stick to everything, even the collection cups, von Byern said. So the researchers froze some of the lines, and then examined them using scanning electron microscopy and X-ray spectroscopy to determine their shape and molecular composition, he said. [Ocean Glow Stick: Sea Worm Emits Strange Blue Glow]]

The results showed that the threads were completely different from the sticky webs of spiders. Spiders usually live in dry areas and need strong webs to ensnare struggling prey. In contrast, the glowworms' lines were not as strong, and were dependent on the moist cave environment to form the sticky water droplets. Moreover, whereas spiders spin silk in their abdominal glands, glowworms pull the lines out of their mouthparts.

During the analysis, the researchers found mineralized crystals containing urea in the glowworm threads. This suggests that the droplets are produced in the midgut, possibly from the larvae's urine, von Byern said. However, he's not 100 percent sure it's urea, and said a chemical analysis of the lines in a future study would clinch the finding.

Urea's sticky properties were already known: Carpenters once made wood glue with a mix of urea and formaldehyde, von Byern said.

The study was published online Dec. 14 in the journal PLOS ONE.

Original article on Live Science.