Airlines know we can’t go a few hours without our precious electronic devices, which is why many airplanes feature power outlets to help people stay plugged-in. Being able to charge your laptop like you would at home is a perk, but how is the electrical socket grounded when you’re 35,000 feet above the Earth?

A plug's grounding pin and the corresponding hole you see on an outlet you have at home is there for safety. In case of a lightning strike or power surge, that prong is connected to the Earth, which gives the excess electrical current somewhere to go besides an appliance (or through you while you are holding said appliance). Wiring airplane power outlets to the Earth below is obviously out of the question, so something else has to take the ground's place as a conductor to dissipate electric current. Luckily, an aircraft’s metal frame is perfectly suited for the job.

“If the third pin (‘ground’) on the receptacle were connected at all, it would be to the metallic structure of the airplane,” electrical engineer Roger L. Boyell tells mental_floss over email.

Grounding, after all, is just a term. As long as it can complete its circuit, electricity couldn’t care less about where the Earth is.

“Grounding on the airframe is analogous to grounding to the Earth,” turbomachinery expert Steven B. Kushnick tells mental_floss, also over email. To electricity, the airplane’s metal frame is a much more desirable conductor than a person, and any time there is stray or excess current, it will always take the easiest path.

Kushnick explains it thusly:

If you had one hand on the stainless steel sink in the lavatory (ground); and one hand on, perhaps, an electric razor that is plugged in and properly wired with a ground-prong, then stray electric currents would have no ‘desire’ to enter your razor-holding hand to get to your sink-touching hand (and shock you in the process) because the stray currents have a shorter circuit to travel: through the ground-prong to ground (airframe).

This remains true even in the event of lightning strikes. “Modern airplanes are frequently hit by lightning,” Boyell says. “Their skin is made electrically conductive to pass the current, much like through a wire, with no effect.” At most, this could “leak through to induce an electromagnetic field inside the airplane,” Boyell says, adding that it “could momentarily disrupt electronic instruments.” Even still, “an electrical device will be unaffected by whether it is plugged into a power outlet on the airplane or not.”