They jettison the flares (rapidly fire all of them) when the aircraft is in an emergency situation. You don't want to have them on board if the aircraft catches fire upon landing.
They have special patterns of flares used to decoy missiles. Not nearly as many as shown in the photos.