Relays are electronic or electromechanical switches that operate under the control of an external circuit.
Originally when first invented in 1835, electromechanical relays consisted of an electromagnet and a set of contacts. When the electromagnet was energized, it closed the contact by attracting a lever held by a spring. When no current is flowing through the circuit, the electromagnet got demagnetized and the spring pulled back the lever and the circuit was left open. This type of relay was widely used in devices such as calling bells.
A special type of relay is a reed relay in which the contacts are enclosed in vacuum tubes in order to protect them from atmospheric corrosion. The operation is otherwise similar to electromechanical relays.
More recently solid state relays have come into vogue. Solid state relays are electronic components similar in function to electromechanical relays. Though initially used for low current applications, these relays are available nowadays for handling currents up to 1200A. They consist of circuits involving transistors and resistors. They have no moving parts and hence no wear out and operate much faster than electromechanical relays.
Relays are widely used in many electric and electronic control applications like overload protection of motors (circuit breakers), temperature / pressure regulators in refrigerators, railway signaling, power systems, starter for automobiles, machine tools etc. As electronic components relays are used in modems and audio amplifiers etc. Modern relays are activated by microprocessor or programmable logic controllers that have the operation logic built in.