Microwaves heat food by passing non-ionizing radiation, typically at a frequency of 2.45 GHz, through it. This radiation excites polar molecules, particularly water, causing them to absorb energy and move. The motion of these molecules generates friction on a molecular level, which translates into heat. As the molecules rotate to align with the alternating electric field of the microwaves, they collide with other molecules, dispersing energy. This process results in the heating of both solids and liquids, effectively cooking the food.