How do Relays Work?

A relay is a simple electromagnetic switch with two independent and separate circuits. They are also comprised of an armature and a spring. When the first switch is turned off the electromagnet stops the attraction of the armature.