All commercial airplanes have a backup for everything. A backup engine, auxiliary fuel pumps, dual spark plugs, dual electrical displays, and circuitry, so the chances of aircraft accident are very very rare.
But how is it managed? What happens in a scenario where even the backups fail? What happens when an airplane loses all sort of power, particularly electrical power.
An aircraft would lose all electrical power when all its batteries and the auxiliary power unit (APU) fails. For an unfortunate situation like this, all commercial airplanes are equipped with a Ram Air Turbine (RAT). The air turbine pops out of the bottom of aircraft and generates electricity from the airstream by ram pressure due to the speed of the plane. The RAT is essentially a mini wind turbine.
The best part of using a RAT instead of a backup APU is that it will never run out of power as long as the plane is flying requiring no fuel at all. It provides a reliable operation on demand, with full flight envelope performance at a very low cost. The Ram air turbine deploys automatically when power on board is insufficient. It drops by a spring load mechanism and gravity.
When the RAT is in use as the power supply, the plane runs in an extreme low-power mode. There is no in-flight entertainment and no lighting. The power produced by the ram air turbine is enough to run basic navigation, basic fly by wire, and limited control of flight surfaces. The power, however, is sufficient for an emergency landing.
So this is how pilots save the day!