Microwaves ovens work by generating microwaves (from an electron tube called a magnetron). When water molecules in the food absorb the microwave energy, they jiggle around like crazy. The friction generated by this jiggling causes heat, which cooks the food. This is why foods with high water content like raw vegetables cook so quickly.