Electronic circuits can function properly only when they are operated in their specified voltage range. Beyond this range the circuit may get instantly or permanently damaged. So how do you obtain from a circuit, a switching voltage output, which may be much higher and dangerous than the operating voltage of the circuit?
This is where electrical relays comes into action. The operating voltage of a typical relay is acquired from the circuit's output itself, but its external 'contacts' can handle and toggle voltages much higher and even at AC mains potential. This voltage is also kept isolated, so that no harm is done to the control circuit.