We can flick a light switch and cause a room to go from dark to light. The electricity to the light sockets is cut two and the switch reinstates the circuit when the two wires are re-connected by a piece of metal. The electrons flow into the sockets, light the bulbs and flow back to their source somewhere on the other side of the meter.
When a circuit is completed, as when the wire goes directly to the socket without going through a switch, electricity flows freely and does its job. The problem is that in the moment (even in the fraction of a second) between "on" and "off" there is immense resistance that can burn the wires or short out the system. The standard toggle switch is not just a piece of plastic flipping a piece of metal between disconnected ("off") to connected ("on"). When the wires are separated, there is what's called "infinite resistance," and when they are connected completely, there is "zero resistance" or connectivity. In both infinite and zero stages, there are no power surges that can cause damage to the contact points. It is for this reason that, even in the simplest switches, there are springs mounted within to flip aggressively the contact mechanism so, like a mousetrap, the connection is made instantly at some point as your finger is flipping from "off" to "on". When breaking the connection (flipping the switch to "off"), there is a further complication in that the electrical load arcs and tends to worsen the corrosion of the contacts, which can quickly shorten the life of the switch. Most switches include a wiping mechanism in the on-off switch so the corrosion is wiped clean at every switching.
A larger understanding of the theories and qualities of electricity is needed to explain how different types of switches, like dimmers, work. You should know the voltage and amperage ratings and ranges of the switches, not to use more than one dimmer switch on a socket controlled from multiple locations, the difference between single and double-point switches and to turn off the electricity before you replace or work with the switches or receptacles. Having a basic understanding of how the electrons flow can demystify even the most advanced switch technology.