When the switch S is closed current flows round the circuit. The electromagnet attracts the soft iron armature and the striker hits the gong.
As soon as the armature is attracted the contacts are opened and the current stops.
The electromagnet switches off, the spring pulls the armature away, the contacts meet and current flows. This is repeated over and over again and so the bell rings.