A microwave oven works by producing microwaves that penetrate food, causing the water molecules within to vibrate and generate heat. The heat then cooks or warms the food.