Microwave fires are extremely common and can happen for various of reasons:
Metal scraps in microwave:A small metal piece is enough to cause a spark inside your microwave. For example you may have cleaned the microwave with steel wool and left behind some metal scrap from the wool.
Damaged wave guide cover: It is very common that during cooking, some food particles and grease escape the food and stick to the wave guide.
Damaged rack support: Some microwaves have a rack supports, which is a hook like part . If the microwave is sparking near one of the support rack, this means that the paint on the rack has worn out.