If you catch them at the right time, some mushrooms have a pretty cool trick up their sleeves: They can glow in the dark. Some 71 of the 100,000 known species of fungus are bioluminescent, Reuters reports, and now researchers can explain why.

It's about reproduction, a study conducted in Brazil reveals. The light attracts insects, and spores stick to their bodies, the Los Angeles Times reports.

The bugs then wander off and spread the spores, allowing the fungi to "colonize new habitats," researcher Cassius Stevani says. That's important for fungi like N.

gardneri, known to Brazilians as flor de coco, which lives in areas without much wind. Flor de coco operates according to a circadian rhythm, or, as the Times explains it, a 24-hour biological cycle.

During the day, the fungus doesn't give off light. At night, however, the light gets "exceptionally intense," says biologist Jay Dunlap. Researchers had previously believed the light was emitted at all hours, Dartmouth's Geisel NewsCenter reports.

Perhaps you've never seen a glowing mushroom, but they've actually been a mystery for millennia: As Stevani notes, Aristotle wondered about their light some 2,000 years ago.

(A famous bioluminescent bay last year went dark.)

This article originally appeared on Newser: Why Some Mushrooms Glow in the Dark

More From Newser