Could a creature like this exist?
Jellyfish or cephalopod-like creatures that live in 'swarms' underwater. They float aimlessly around in a net formation. When one member detects prey below the formation they send a signal to the rest of the swarm.
A single member is 'elected' to be sacrificed in hunting. This member begins electrolosis, storing oxygen and hydrogen in lung-like sacks. It's body contracts, causing it to sink, leaving the formation where it is replaced. It continues to sink to the same depth or nearby to prey where it generates a spark, igniting the hydrogen and oxygen. The detonation causes a shockwave that kills the prey which floats into the swarm net above where it is consumed.
The swarm is protected by an outer ring of individuals that create fiery bursts to ward off predators.