A glyptapanteles is a type of wasp that stings other insects that then forces them to host its larvae, or wasp babies. (Cecilia Escobar/USDA Systematics Entomology Laboratory)

The sting of a wasp can be painful to humans. But for certain caterpillars, spiders and worms, it can mean being turned into a puppet slave for days, until they die a grisly death.

Sound like the stuff of Halloween nightmares? It’s just an ordinary day in the world of insects, where an estimated 10 percent — about 120,000 species — are parasitoids (pronounced pare-uh-si-TOID). That is, they occupy and live off a host insect, eventually killing it.

Parasitoid insects have been around for at least 100 million years, since before there were dinosaurs, says Floyd Shockley. He is collections manager in the department of entomology at the Smithsonian National Museum of Natural History.

A lot of them are hymenopterans (hi-me-NAHP-ter-ans). This is the order that includes ants, bees and wasps. Shockley says this makes sense because “they’re already equipped with stingers to inject chemicals” to make their victims do their bidding.

They’re also all females. That’s because there’s only one reason parasitoid insects take over other insects: to lay eggs in them. Hatched larvae munch on the insides of their still-alive host. Then, when they’ve matured, they eat their way out.

There are fly parasitoids that decapitate (or take the heads off) fire ants. Hairworm parasitoids that make grasshoppers jump into water and drown. Even a fungus that pierces the heads of ants to distribute its spores.

“But wasps,” Shockley says, “do some of the coolest stuff.”

Glyptapanteles (glip-tuh-PAN-teh-leez) wasp larvae feed on an inchworm’s insides till they’re ready to pupate, or live in a cocoon-like structure. Then they push their way through its skin and attach to the outside of its body. “Two larvae stay behind inside, manipulating the worm into protecting their brothers and sisters,” says Shockley.

Anelosimus eximius (an-eh-LOSS-ih-mus ex-IH-me-us) spiders build webs in groups and kill invaders. So, Zatypota wasps inject a chemical into a single spider that makes it wander off to spin its web alone while larvae feed on its blood. Shockley says other parasitoids use their hosts’ existing behaviors. But Anelosimus eximius doesn’t know how to build a web by itself. “The wasp programs a totally new behavior in the spider that it wouldn’t do on its own,” he says.

Shockley’s favorite parasitoid might be the emerald wasp. It stings a much larger, heavier cockroach, making it docile. Then it climbs on its head and steers it by its antennae back to its nest “like a dog on a leash,” Shockley says. “It’s weird.”

Scientists only recently developed the tools to study parasitoid wasp DNA. They’re researching how hatched larvae avoid triggering immune responses, reactions that would make their hosts kick them out. They think this is important for understanding human immune responses.

Unfortunately, this research might get harder. Insects are in decline around the world, and Shockley says parasitoid insects are especially vulnerable. They usually have only one or two insects they evolved with, “and don’t have alternate hosts they can switch to,” he says. Experts are not sure what fewer parasitoid wasps will mean to the health of the Earth in the future. But it will have an effect — possibly even on humans.