Mags still produce electrical energy until the engine completely stops. When you shut the mags "off" you are simply providing that energy an alternative path to ground... directly to the airframe,...