A flare is deployed to decoy infrared-guided missiles. In mid-air, they create a bright source of heat, preventing the missile from tracking the aircraft’s heat signature. It can fool the missile into believing that the flare is the aircraft.
A single flare has a very low chance of decoying a missile. If an aircraft launches multiple flares in quick succession, the chance of survival increases considerably.
Presenting a very serious danger at wartime, this maneuver is indeed an impressive firework at peacetime.