Fire didn't exist for 90% of Earth's history because there wasn't anything to burn on our barren planet of dust and rock. It was only around 400 million years ago that the first land plants appeared and provided both fuel and the critical 13% oxygen in the atmosphere that made fire possible. Around 1.5 million years ago, early humans learned how to control and use fire.
The enemy of my enemy is my friend... Some species in the deep ocean use bio-luminescence as a form of "burglar alarm". The objective of the light display isn't to scare away the small predator who wants to eat them, but rather to attract a larger predator to eat the smaller predator, allowing the original prey to escape.