Bioluminescence is a light, right?
Lights on any animal, like a firefly or, in your case, a jellyfish, shows predators to back off and shows you that it's either poisonous or will hurt you. If it were to stay unseen in the darkness, predators would still not understand that it were poisonous or would hurt you
↑↑↑ Hope this helps! :D