A toaster works with tungsten alloy resistors to generate heat directly from electricity, and are used to toast bread, hence the name. Microwave ovens operate by transforming the 110/220/230 V up and using that to generate a strong, hight frequency changing electromagnetic field that accelerates the bipolar molecules of the food, such as water or triglycerides, and thus heating them up, because heat is just the kinetic energy of particles. It doesn't generate heat by itself, but toasters do.