Mediocre heat conductors like water get hot when bombarded with microwaves.
Good conductors like metal get charged with a large electrical field.
Eventually, it’s enough to arc across air to a wall or some other conductive part inside the oven, creating a massive electrical spark.
Objects that have pointed metal like forks can create an sparks when microwaved.
This is because the tines of the fork resonate with the microwave radiation and produce high voltage at the tips.