Microwave ovens are really kind of awesome when you look at them from a scientific perspective!
There's a transmitter inside the microwave that sets up an electromagnetic field when you press "start" and radiates microwaves at a certain frequency just within the confines of the microwave. These microwaves are special in that they are readily absorbed by water and a few other organic materials, but less so by materials like plastic and glass.
This means that when the microwaves hit your leftover burrito, most of the organic molecules inside the burrito start to jiggle, creating heat. This causes the food to warm up quickly and relatively evenly while the container itself stays cool. (The material of some containers will still absorb microwaves and will get hot if microwaved for long periods of time.)
Microwaves don't always penetrate all the way into the middle of foods, however. If you have a big piece of steak, you may have to cook the steak a little longer for it to heat all the way through. With something like soup or pasta with sauce, you may have to stir the food a few times to make sure the heat gets evenly distributed.
In a nutshell, that's how every microwave works. For more detailed information, check out some of these sites:
Science rules. Let's go eat some lunch.
(Image: Emma Christensen)