Magnetrons generate microwaves, while relays are switching devices.
Microwaves are generated by a magnetron in microwave ovens, not by relays. Relays are used for switching circuits.