Percy Spenser was conducting radar experiments during World War II when he got close to a microwave-emitting tube and accidentally melted the candy bar in his pocket. (Eureka!) Spenser quickly understood the sweet implications of the event, and soon patented the first microwave heating device.
But how does a microwave work? Let's zap some lunch and find out.
The frozen burrito in your microwave oven sits in an electromagnetic field, bombarded on all sides by high-frequency microwaves. Free water molecules (along with some fats and sugars) absorb the microwaves, and the resulting vibrations cause friction between molecules (i.e., heat).
Because not all the water in your burrito has frozen (due to the presence of other chemicals, like salt), heat is generated in those pockets of free molecules sooner than in frozen areas. That's why your burrito sometimes comes out unevenly heated.
Why can't you wrap your meal in aluminum foil? Metal blocks the high-energy particles of the electromagnetic field, making for more trouble than a melted candy bar.