Micro waves are a part of elctro magnetic spectrum.
Inside micro wave over an equipment called magnetron converts ordinary current into micro waves which penetrates the food, creates molecular vibration. to heat up food.
Heating of food in a microwave oven is neither through electrical resonance nor through mechanical resonance.
Water, fat, and other molecules of the food absorb energy from the microwaves via dielectric heating.
Many molecules (e.g., as those of water) are electric dipoles. These dipoles try to align themselves with the alternating electric field of the microwaves. (We know that Microwaves are non-ionizing electromagnetic radiation with a frequency higher than ordinary radio waves but lower than infrared radiation.) Thus the agitated molecules hit other molecules and transfer energy both as kinetic as well as potential energy of constituent molecules. This molecular vibration energy in solids and liquid food items is seen as heat.