Magnetrons generate microwaves, while relays are switching devices.
Microwave ovens produce microwaves using a magnetron; relays are employed for circuit switching.