In racing, a fuel cell is a type of fuel tank
designed not to rupture in the event of an impact. Fuel cells were first develped from aircraft self-sealing
fuel tanks, which were designed not to leak after combat damage.
Fuel cell development really began in the 1960s, when quite a number of racers died because of burns, most notably Fireball Roberts at Darlington in 1964 and Lorenzo Bandini at Monaco in 1967. Early racing fuel tanks were prone to rupture after a serious impact, spilling the entire contents quickly. Given the volatility of racing fuel and the profusion of hot parts and sparks after an accident, fire was always a serious danger. The danger hit home after Swede Savage crashed while leading the Indianapolis 500 in 1973. His agonized face, while he stared at the burns that would take his life were plastered across many papers.
There are several parts to the modern fuel cell. First is the container, which is generally metal, but may be made of rotary molded plastic. Inside is a flexible rubber bladder, which is capable of deforming under impact and penetration resistant. Inside that you have foam blocks, really they resemble a very sparse sponge and it is designed to both pass fuel but somewhat plug any penetration. The foam offers the additional benefit of reducing the amount of 'fuel slosh' inside the cell as the car turns.
All perforations, including the refueling cap, tank vent and fuel pickup are guarded either by flapper valves or ball valves to seal the tank in the event of a rollover.
Fuel cells have been extraordinarily successful in practice, particularly when used with modern fire extinguishers and SFI rated firesuits. Driver deaths by fire, once commonplace, are now very, very rare.