When a small current flows through the relay coil, it activates the electromagnet, creating a magnetic field. The magnetic field attracts a contact in the relay, closing the switch and allowing a larger current to flow through the switch. When the current stops flowing, the contact returns to its original position, opening the switch.