Relays are electromagnetic controlled switches. They are normally composed of an electromagnet and one or more pairs of contacts. The contacts can be normally open (N.O.) or normally closed (N.C.). That is they are open when the electromagnet is off or closed when the electromagnet is off. There are also latching relays. When a coil is activated in a latching relay, the contacts will open/close, and remain in that posision even when the coil is deactivated. In order to put the contacts back into their original posision the coil must be actevated in the reverse polarity, or a second coil must be activated, depending on the relay.
The relay, like many switches, comes in single-pole single-throw (SPST), double-pole double-throw (DPDT), etc...
Some relays are shown above. In some of the relays, a diagram of the pins, and where they are connected to is shown. Others are clear, and you can see where everything goes.