There are two types : piezo buzzer and magnetic buzzer
The magnetic buzzer is driven by the electromagnetic principle, the metal diaphragm is pulled when input the current and spring back without current. Basically the magnetic type has very compact dimensions, high SPL 80-100dB and input current of 30 - 100mA.
The piezo transducer generates the sound due to the piezo-effect. By driving it with square wave voltage the piezoelectric ceramic pulls the metallic diaphragm to vibrate. The piezo type has relative large dimension , low SPL 65-110dB and low input current of 2- 10mA.