A door bell is a simple electromagnetic device and requires very little energy to do work. So what are electromagnets and how do they work? Electromagnets are temporary magnets. They have magnetic effect as long as they are supplied with electricity.
Electromagnets consist of a metal wrapped with a piece of conductive wire (mostly copper wire). Winding should be in the form a coil in order to generate strong magnetic field when current flows through it. It is simply a piece of metal when there is no current flowing through the coil. But when current is made to flow the coil, a magnetic field is created around the coil. Now the metal acts like a magnet. The magnet has got two poles - North and South. If in case it comes in contact with another electromagnet, like poles repel and unlike poles attract, or if comes in contact with metal like iron, the magnet attracts the metal. You can try connecting a nail wound with a wire to a battery and see how it attracts pins. Apart from door bells, the electromagnetic property is used in induction cook top too.
While one end of the transformer is connected to the supply from the mains, the other end is connected to a metal contact. Now when the circuit closes, the metal contact acts as an electromagnet. The magnetic field created helps ring a noise making apparatus.