A DC relay is a relatively simple device that uses a single coil, normally wound round an iron core. When a voltage is applied, current flows through the coil and generates a magnetic field. As the magnetic field increases, a spring loaded lever is attracted to the core and moves the switch contacts from an "off" state to an "on" state.
The lever will be held in place as long as the current flows in the coil. When the coil current drops to zero, the magnetic field decays and the lever is released, the spring then pulls it back to it's off position.