Fireflies emit light mostly to attract mates, although they also communicate for other reasons as well, such as to defend territory and warn predators away.
In a firefly’s tail, you’ll find two chemicals: luciferase and luciferin. Luciferin is heat resistant, and it glows under the right conditions. Luciferase is an enzyme that triggers light emission. ATP, a chemical within the firefly’s body, converts to energy and initiates the glow. All living things, not just fireflies, contain ATP.
Fireflies are found on almost every continent.
Fireflies love warm, humid areas. Because of this, they thrive in tropical regions as well as temperate zones—they come out in the summertime in these environments—on all continents except Antarctica. Fireflies thrive in forests, fields and marshes near lakes, rivers, ponds, streams and vernal pools. They need a moist environment to survive.
Some species of firefly larvae are generally aquatic—they even have gills—while others live almost entirely in trees.