Switches in a circuit work by opening or closing the electrical pathway to control the flow of electricity. When a switch is closed, it completes the circuit and allows electricity to flow through, powering the connected devices. When the switch is opened, it breaks the circuit, stopping the flow of electricity and turning off the connected devices. This simple on/off functionality of switches is essential in controlling the flow of electricity in a circuit.