Let’s see how this works. Inside the microwave oven, a device called magnetron generates the microwaves which are fields of electrical and magnetic energy. These are directed by an antenna to a hollow tube called waveguide. The tube in turn channels the waves to a fanlike stirrer that disperses them around the oven’s interior. Finally, the waves reflect off the oven’s walls and are absorbed by water molecules in the food.
It is the water that plays key role in cooking. Each molecule of water has a slight positive charge at one end and a slight negative charge at the other. The molecules lie randomly in the food. But as they absorb the microwaves, they align themselves with the waves’ electric field. The electric field oscillates billions of times a second, constantly agitating the water molecules and forcing them to turn round 180° as many times.
In other words, as the microwaves oscillate, so do the molecules. This rapid molecular agitation generates heat and cooks the food. If the food is very thick, the microwaves will not penetrate completely and the food’s inner layers will cook by conduction. Since microwaves don’t produce heat unless they are absorbed by water molecules, many materials such as glass, paper and most plastics can be used safely as cookware.
Microwave oven (Wikipedia)