A relay consists of a coil and a switch. If voltage is applied to the coil, a magnetic field is generated which closes or opens the switch. A special feature is that when switching with the coil, is that there is no contact between the controlling and the controlled circuit, which is very useful if we want to control high voltages or loads with a low voltage microcontroller. The mechanism in a relay work with inductive loads, so we will often need a protective diode and/or a transistor to control them with a microcontroller.
In this relay model, If voltage is applied to the coil of the relay, the A-B path is connected. If there is no voltage on the coil, path A-C is connected. Unfortunately, it is not possible to send a PWM signal to a relay because it switches too slowly. Most relays require more power to switch than an Arduino digital pin can provide, so you will often need a transistor as well.