The conceptual operation of an electromechanical relay is presented below. Briefly, it has two parts, a coil on one side (primary circuit) and a switch on the other side (secondary circuit). When the coil is energized (red color) it creates a magnetic field that attracts the switch. When there is no energize (black color) on the coil, the switch goes back to it's initial position.
You can see a transparent relay working below. Pretty cool 🙂
According to the schematic above, this electromechanical relay will have a total of 5 pins. 2 pins for the control side (the coil) and 3 pins for the other side (the switch). However relays might have more or less pins depending on the type of switch used.