Mezcal worm
A mezcal worm is an insect larva found in some types of mezcal produced in Oaxaca, Mexico.  The larva is a red maguey worm, the caterpillar of the Comadia redtenbacheri moth, usually called  or  ("red worm"). The red worm is typically considered tastier than a white maguey worm.

On a bachelorette party in Mexico, the historical tradition is for the maid of honor to eat the worm. This is known as representational symbolism, in which the future bride passes the torch to her closest loved one – akin to a throwing of the bouquet.

History
Although the custom is relatively recent, larvae are used frequently by several brands of mezcal to give flavor to the drink. A whole larva is deposited in the bottle, normally after having previously been cured in pure alcohol. Nacional Vinicola (NAVISA) was the first company to add a worm to its Gusano Rojo mezcal. Andres Paniagua and Jacobo Lozano, creators of Gusano Rojo and Dos Gusanos, first introduced the practice of adding larva to mezcal. Today, several brands are doing this including Patron.

Other kinds of worms
The other variety of "worm" in mezcal is the larva of a weevil known as picudo del agave, Scyphophorus acupunctatus, the agave snout weevil, that infests certain species of yucca and maguey. They are not related to edible maguey worms.

The weevil is a pest that can severely damage agave plants by eating the plant to death from the inside.  If only a few infest the plant, they can still carry and infect the plant with harmful bacteria leading to plant death. In some cases, up to 40% of a maguey harvest has been lost to weevil infestations. Infection-resistant varieties of the plant are being developed.

Picudo larvae may be roasted and eaten; they are a seasonal specialty of markets in southeastern Mexico.

See also
Maguey worm
Vodka Villa Lobos

References

Insects of Mexico
Insects as food
Mexican cuisine
Worm
Larvae
Insect common names