Air is not a perfect insulator of electricity. When you pull the plug out, there is a brief moment when the pins aren’t touching inside the socket, but the gap is small enough that the electricity can jump across the gap as a spark, called *arcing*. When this happens, the air gets superheated and glows for a split second. This is the light you see. It can be even worse if the thing you’re pulling out has a transformer because of how they work. In fact, this is why light switches always click. They are designed to keep that sparking to a minimum as it can damage the contacts in the switch.
Latest Answers