A miniature radio station or magnetron tube sends microwaves into the oven cavity. Inside the oven they "bounce around" to give even cooking.
Microwaves "bounce" off of metal. Therefore, we cook in a six sided metal box so they won’t get out into the room. This makes them very safe to use. They pass through plastic or glass, like sunshine goes through a window pane, with no effect at all. Therefore, we cook in utensils made from these types of materials. The microwaves are attracted, like magnets, to the fat, sugar and water within the food. Water molecules are very good absorbers of microwaves, sugar and fat are better and salt is best. Thus, foods high in fat, sugar and salt will cook faster and get hotter than foods made up primarily of water such as vegetables.
Microwaves penetrate the foods about 1 inch in all directions (top-bottom and sides) causing the water molecules to move and vibrate against one another at the rate of 2 1/2 billion times a second. The microwaves don’t actually cook the food. The friction caused by the vibrating molecules produce the heat which does. Microwaves do not actually touch most of the food they cook. The heat from the vibrating molecules on the outer edges of the food must go somewhere. It is by "conduction" this heat moves inward, layer by layer, to cook the food. Therefore, cooking larger, more dense foods starts on the edges and heat is conducted to the center.
Stirring will help food cook more uniformly as it redistributes heat from the outer layers of the food to the inner layers. Arrangement of the food, the dish style (round vs. square), denseness of food, etc. can all play important roles in microwave cooking.