I’ll get to the point: animals and fungi glow because they like to rave throughout the night.
The truth is, organisms glow for many reasons (raving being one of them).
Some animals glow as a form of counter-illumination. The firefly squid is one example of this. If a predator is swimming below the animal and looking up at it, it actually makes a dark background against the surface. When lighting up, the squid can blend itself into its surrounds a little bit better.
The light is produced is in photophores, basically an organ whose job is just to produce photons. The badass thing with this is that animals, instead of producing the photons themselves, will sometimes house a bacteria (Allivibrio fischeri) in the organ in a symbiotic relationship (=BFFs). In this case, it’s the bacteria that is actually bioluminescent.
Take this anglerfish, for example…yes, it’s also the creepiest thing I’ve ever seen. I bet rotting livers on dead people are more attractive. But the anglerfish DGAFs whether or not its body is attractive or ugly…because it’s that danging light blob that does the actually attracting. (Ever more precise: it’s the bioluminescent bacteria living inside the bulby organ.)
Lil’ fishes get curious when they see a light floating around in the ocean…and they go explore…and then they get eaten up by the ugly-but-efficient anglerfish. Work smart, not hard, says the wisdom of the anglerfish totem.
Love. Ahhhh. The reason for being alive and the culprit for all of our friggin problems. We try to hard putting ourselves out there and also trying to play it cool.
Wouldn’t it be badass just to have your eyeballs light up whenever you found someone attractive? No need to be so vulnerable.
Another reason why bioluminescence occurs is to attract a mate. This is one of the more commons reasons why animals (and fungi) barf out photons from various parts of their bodies.
Okay, so NOT literally. I actually have no idea what’s happening to that fish. Maybe it thought a glowstick was some Pop Rocks.
What I was referring to was insects like fireflies. Different species of fireflies light up in different patterns, just like morse code. This helps communicate to the ladies: “Hey babe, look how hawt I am, come on over!”
There are many more animals that are bioluminescent for the same basic reasons: to attract mates or defend against predators.