The aluminum body of the airplane acts as a faraday cage, by redirecting lightning around, instead of through the airplane. There is a bit of capacitance inside the plane, so somethings can be affected by the lightning, though almost never causing fatal damage. The lightning is mostly passing through the body of the plane towards the ground, which has the highest capacitance.
The parts of the planes that are most sensitive to lightning are the computers. All of which have surge suppressors to block electrical surges from damaging them.
Latest Answers