The electric bell contains an electromagnet, consisting of coils of insulated wire wound around iron rods. When an electric current flows through the coils, the rods become magnetic and attract a piece of iron attached to a clapper. The clapper hits the bell and makes it ring.
Working of an electric bell
Electric current flows through the coil when the switch is ON, and the iron core acts as an electromagnet. The iron core attracts the hammer towards it. The hammer hits the bell and produces a sound. The circuit breaks at the screw contact when the hammer moves towards the iron core. At this point, the iron core ceases to be an electromagnet. The hammer is pulled back to its original position due to the spring action of the steel rod and then touches the contact again to complete the circuit. The circuit is completed and current flows through the coil again, and the hammer strikes the bell again. The process repeats itself and you hear a ringing sound since the hammer keeps hitting the bell until the switch is released.