The switch simply opens (off) or closes (on) the connection between the two terminals on the switch. When the switch is on, current flows along the black wire through the switch to the light, and then returns to ground through the white wire to complete the circuit.