Why is my microwave sparking?
Sparking, properly called arcing, means microwave energy is concentrating somewhere it should not. It should be treated as a stop-now situation rather than something to watch, because continued arcing can damage the magnetron, which is the expensive part.
The benign causes are worth ruling out first, since they are common and easily fixed.
Metal in the cavity is the obvious one, and it includes things people overlook: a fork left on a plate, a twist tie, decorative metallic trim on a dish, and takeaway containers with a metallised lining. Aluminium foil arcs readily, especially if crumpled or touching a wall.
Food debris on the interior, particularly burnt-on splatter, can carbonise and arc. Cleaning the cavity resolves this and is worth doing before assuming a fault.
The most common genuine fault is the waveguide cover, a small rectangular panel usually on the side wall, made of mica. It shields the opening where energy enters the cavity. It absorbs grease and food splatter over time, and once saturated it chars and begins to arc. It is an inexpensive part and generally straightforward to replace, and this is by far the most frequent cause of arcing in an otherwise healthy microwave.
Some foods arc on their own, notably certain vegetables with high mineral content such as carrots and spinach, because of concentrated mineral deposits. This is harmless and not a fault.
If the cavity is clean, nothing metallic is present and the waveguide cover is intact, the fault is internal. Microwaves store dangerous voltage in a capacitor even when unplugged, so internal work is genuinely hazardous and belongs with a qualified repairer.