In normal use the motor circuit is controlled by the heavy switch in the
piano (in the drawer or spoolbox). The switch itself dissipates the
energy stored in the motor winding as a big spark, but this surge doesn't
travel out the power cord. However, if the piano switch is left 'on' and
the piano is controlled by an external switch or relay somewhere (as in a
pipe organ installation), then the big voltage surge leaves the piano via
the power cord. Thus bad wiring between the power cord and the switch in
the piano could go undetected for years, only to wreck havoc after the
external relay is used a few times.
I suspect that the condition of the rubber insulation in the wiring is as
variable as in the rubber hoses elsewhere in the piano. Once it hardens
from age and cracks, then dust and grime can seep through the cracks and
ultimately cause a flash-over when the piano is switched off.
A simple and cheap protection is the varistor surge protector, also
called voltage-dependent resistor (VDR). This little disc-shaped device
is connected across the switch contacts and will absorb and dissipate the
energy which otherwise causes the big spark when the switch opens.