When microwaves hit the metal you put in your microwave, free electrons on the metallic surface end up moving from side to side very rapidly.
in turn, prevents the electric wave from entering the metal, and the waves end up being reflected instead.