Too many analogies - a love story
The capacitor can be explained in many different ways. The “cap” has also many different uses. When used as a spike suppressor, consider the cap to be a flood valve.
Only sudden bursts in the voltage will be shorted. The DC voltage will be blocked. How long and high a burst will be suppressed is depending on the capacitor’s “capacitance” or capacity. Capacitance © is the official, nerdier word. The unit for this is the Farad (after Faraday). One Farad is a ■■■■■■■■ of C. That’s why we use much smaller units. Like a millionth (micro, uF) or a billionth (pico, pF) of a Farad. Smaller even sometimes.
Inside the cap, the leads are not “touching” each other. That’s why it will not conduct a decent current. Instead, it has two surfaces very close to each other, all wrapped up in a very tight package. Even tough the electrons cannot travel across from one surface to the other (they are separated by an insulator), they sure can “feel” each other’s presence on either side of this barrier.
Very psychic they are, these electrons. The larger the surface area, the more room there is for extra electrons to settle in and have a pick nick in each other’s company albeit separated. Very Romeo and Juliet. For some reason these electrons are only attracted to the ones they cannot have. All Romeos one one side and all Juliets on the other. And not a gay one among them.
It’s the different “electrical potentials” on either side of the cap that makes the difference (between boys and girls). Such a difference is what we call “voltage” in every day robot building. The higher the difference, the more passionate the lovers. When a sudden electrical burst (motor noises) brings that voltage up, more electrons on either side go into the capacitor. They have a bigger urge to do so. When the peak subsides, electrons will return to their daily routines. But in the mean time, a massive over voltage has been averted in your motor driver.
From outside the cap, it just looks like electrons went into the cap when there were “too many” around. This analogy is false and the first proper electrical engineer to read this will most likely scold me for it. But from the perspective of an average robot hobbyist, that’s why you want a capacitor across your motor leads.
BTW, this story has a happy ending. The Romeos and Juliets will get each other in the end. Just not inside the capacitor.