An electric light will only glow if it is part of a complete circuit, meaning that current from the power company must flow through wires to the light and then return through wires to the power company for reuse. Any break in the circuit's wiring will stop the flow of current and extinguish the light.
In an ordinary single-switch circuit, the switch simply breaks the circuit when you turn it off. That simple type of switch-one that connects two wires when on and disconnects them when off-is known as a single-pole single-throw (SPST) switch.
Controlling a light with two independent switches is harder and requires more complicated switches. Known as single-pole double-throw (SPDT), these switches connect one incoming (or outgoing) wire to either one of two outgoing (or incoming) wires. When you flip the lever of an SPDT switch, you connect the single wire to the other one of the pair.
In a two-switch circuit, current arrives at the first switch through a single incoming wire and leaves it through one of two outgoing wires. This current travels to the second switch, where it arrives through one of two incoming wires and leaves through a single outgoing wire. The two switches are thus linked by two separate wire paths. If both switches are connecting their single wire to the same link wire, current flows through both switches and the light is on. But if the two switches are connecting their single wire to different link wires, no current flows and the light is off.
Interestingly enough, it's possible to control a light with more than two switches. In that case, the first two switches can still be SPDT, but the other switches must be even more sophisticated. They must connect two separate incoming wires to two separate outgoing wires. The switch pairs each incoming wire with one of the outgoing wires and flipping the switch reverses the pairing.
Answered by Louis A. Bloomfield of the University of Virginia