Halldor Gudmundsson had just seen a huge lightning strike near his office, northwest of Keflavik International Airport in Iceland. He flipped open the camera app on his phone and started recording, hoping to catch another fork of electricity rip through the sky. But suddenly a plane, taking off from the airport, flew into view – and was immediately struck by a flash of lightning.

It was an extraordinary sight, but the aircraft soared on regardless, through heavy rain. “It was very fun to see, but also a bit scary,” says Gudmundsson, whose footage provided this extraordinary photograph.

The Wow Air flight from Iceland’s capital Reykjavik to Paris on 3 October arrived safely and the airline confirmed to the BBC that the plane was not damaged in any way. As a Wow Air spokeswoman pointed out, it’s not uncommon for aircraft to be struck by lightning. How, then, do they survive a sudden shock amounting to approximately 1 billion joules of energy – equivalent to a quarter-of-a-tonne of TNT.

The “skin” around the cabin and interior compartments of an airplane is designed to conduct electricity but keep it away from the crew, passengers and electronics inside, explains Chris Hammond, a retired pilot and member of the British Airline Pilots Association (Balpa).

“There’s a metal mesh that goes into the skin of the airplane,” he says, “a sort of gauze that goes the whole way through – and that’s how the electricity is conducted.”

Like a flying Faraday Cage, everything on board is protected  

In addition, the electronics and connections to the fuel tank, for example, are heavily shielded to protect them from external electrical bursts. All of this is rigorously tested before an aircraft goes into service – a process that involves simulating lightning strikes to the skin and internal components.

Gudmundsson’s photograph, notes Hammond, is an illustration of everything working exactly as it should. The bolt appears to enter the plane at the nose and then exit via the tail and part of the wing. Like a flying Faraday Cage, everything on board is protected.

A lightning strike is still likely to be noticed by people on board, though. Passengers on two flights that were hit over west London in April reported hearing loud bangs, for example.

Years ago, aircraft were not as well insulated from strikes. Hammond remembers piloting an early airliner while waiting to land in San Francisco. After a particularly bad flash, he recalls, “all the screens went blank”. Thankfully, the aircraft was equipped with analogue instruments at the time. While the computers gradually came back online, the plane was able to land safely.

Join 700,000+ Future fans by liking us on Facebook, or follow us on Twitter, Google+, LinkedIn and Instagram

If you liked this story, sign up for the weekly bbc.com features newsletter, called “If You Only Read 6 Things This Week”. A handpicked selection of stories from BBC Future, Earth, Culture, Capital, Travel and Autos, delivered to your inbox every Friday.