A relay is an electrically operated switch that uses an electromagnet to mechanically operate a switching mechanism, allowing a low-power signal to control a high-power circuit. Relays are critical in applications where isolation between the control and output circuits is necessary, providing safety and functionality in various electronic and electrical systems.