A microwave leaves the air around your food cold. The energy goes into the food, and the food turns that energy into heat.
Water is an electric dipole. Oxygen pulls charge slightly negative, the two hydrogens sit slightly positive, and in an alternating electric field the molecule keeps trying to turn to line up with it.
The field inside a microwave reverses 2.45 billion times a second. Water molecules keep trying to follow, and molecular interaction turns that absorbed energy into heat. The food is the heating element.
The box matters as much as the magnetron. Metal reflects the waves back inside. The door mesh has holes far smaller than the roughly twelve-centimetre wavelength, so microwaves cannot pass through, while visible light at a fraction of a millimetre goes straight out to your eye. Reflections set up standing waves with hot and cold zones a few centimetres apart, which is the whole reason a turntable exists.
And no, it does not cook from the inside out. Penetration is about one to one and a half inches.
The microwave supplies the energy. Your food absorbs it and turns it into heat.
