Ingnition parts will leak electricity to unintended places. "Arcing" is what it's called.
Under a load they leak more.
Or it could be fuel strvation...
Waaaay back in the old 70's I opened the hood on a friend's misbehaving car.
It was night time and dark.
While he revved the engine I was treated to a light show around the plug wires!
Proper trouble shooting will lead you to the cause but if you wish to be a "parts changer" start with inspecting the rotor and cap. If they're not very clean replace them. If they're looking good, wires and plugs are next.
Or...it's fuel starvation...