Relays are electromechanical devices used to manage electrical circuits by opening or closing a terminal based on an input signal. Their construction typically involves a coil, a set of contacts, and a mechanical armature. When electricity passes through the coil, it creates a magnetic field that pulls the armature, causing the contacts to engage.