Relays are electronically controlled switches. For mechanical switches in relays, electromagnets are used. Besides these, solid state relays which don’t have any moving parts are also used. Relays are used when high currents have to be controlled with low level signals or controlling multiple circuits from a single source.
The first relay applications are used in telegraph operations to amplify signals. In these applications telegraph signals were losing amplitude because of being transferred over long distances. Relays were used to amplify the lower signal. The first examples of relays are used in phone communication and logical operations in computers.
Relays which are used to directly control high loads like electric motors are called contactors. Solid state relays which are used in power applications use semi conductors for switching instead of moving mechanical parts. Relays are used to protect circuits from heavy load or errors. In modern electric power systems these protections are carried on by digital tools, but these are still called “protective relays”.