Relays are used when you want to switch a large amount of electricity with a small amount of electricity. For example, you could use a relay to enable an microcontroller to control the outlets in an AC power strip.
Relays are mainly used in three distinct applications or engineering needs:
When connecting or interfacing inductive loads such as motors to a control circuit such as one provided using microcontrollers. Since microcontrollers cannot drive head load amp savvy devices, relays are used to provide high current drive. They can also drive lighting systems or light shows used in live music performances.
Relays also protect their respective control systems by preventing back EMF damaging the control circuit components when the motors are switched off. Back EMF is a phenomenon in which inductive loads can (and generally do) generate very high voltages, high enough to destroy the breakdown voltage of semiconductors.
Relays allow multiple loads to be grouped as functional loads such as lighting systems in live music shows. Certain lights can be controlled by relay A, stage lights controlled by relay B, special effects (fireworks) controlled by relay C, etc.
Relays are also widely used when the need to control devices at a long distance such as railroad switches. A control station can send individual control signals to remotely located systems or components.