A magnetron is an electronic device that converts electrical energy into microwave radiation. It is used in microwave ovens to generate heat and cook food.