The video below tell us about how does a relay work. How does a relay work is like this: there are two components on a relay, switch and an electromagnet. When the electromagnet is powered (by turn on the switch inside the cockpit) then the magnet comes alive.

When the magnet comes alive, the magnet will pull the switch closed. And the electricity will flow through. When the switch turned on, all the heavy lifting, all the power is flowing through that switch. Later, if you turn the switch off inside the car, the magnet is go away, the switch pop open again and the electricity goes away. That’s how a relay works.