Welcome back the Electronics From Scratch, the most irregular electronics series on the entire internet!
In the last two installments we learned about transformers, which we use to convert high AC voltages to lower ones (or the opposite). We then learned about the diode, a one way valve for electricity.
We used the two to create rudimentary circuit that gives 35 Volts:

Which looks like this on an oscilloscope:

So, we have DC power, but it's not the smooth and stable kind that we want. It's inherited AC’s constantly changing voltage over time. We need another component to help us solve this problem.
Introducing Capacitors
PHYSICS ALERT!
For length reasons, this is the first of two posts discussing capacitors. It is mainly a layperson's explanation of the physics involved, enough to give a taste without getting into the nitty gritty of edge cases or mathematical equations. The second post will be the one where we actually put capacitors into our power supply.

A capacitor is a funny little friend. Like a diode, it has two connections, but don't let that fool you, they have nothing in common.
Capacitors can come in many shapes and sizes, can be made out of many different materials, and can be put to work in many different ways. But they all have some basic principles in common.
Let's look at the circuit diagram symbol for a capacitor:

This is interesting! Unlike all the symbols we've seen so far, this one isn't one solid shape. There's two identical conductive plates separated by a gap. In fact, that gap represents a dielectric, an insulator, preventing electricity from flowing from one side to the other.

According to everything we've learned so far, this is a broken circuit and can't do anything. But it does, and we use them all the time. So what's going on?
What a capacitor actually does
To find out how a capacitor works, we need to take a moment to understand atoms. You’re probably familiar with this classic representation:

The atom here is shown as a core, or nucleus, with electron particles flying around in orbit. Not a bad representation, but it misses out something. The nucleus itself is just a ball made up of two different particles, protons and Neutrons:

(This atom is drawn as a 2D shape so that you can see every single particle at once. In real life, they are spheres.)
The movement of these particles is how we get power to flow. The proton, for example, is a positive particle. If we were to make protons flow from one place to another, then power will come with it.

Let's try that now:

Well, it turns out that the protons are stuck inside the nucleus pretty good. Getting them out involves the process of nuclear fission, as made famous by American war crimes.
Electrons are more loosely bound to an atom. They spend their days orbiting the nucleus from a distance rather than being embedded in it, so it's not so big a deal to make them flow. (that's why they're called electrons).
Electrons are negative particles, directly opposed to protons. They do the exact opposite of what protons would do, and that includes how they move in relation to the flow of power:

You see that? The power is going one way, but it's actually being transferred there by the motion of the electrons going in the opposite direction. If you take negativity away, you get positivity!
I suppose this is why voltage is a measure of tension. Voltage might push power, but it pulls electrons.
Anyway, here's our capacitor diagram again, showing how full of electrons it is:

As you can see, both plates are identical, so they’ve both got the same number of electrons in there.
Now let's connect one of the two plates to the positive side of a battery. We’ll call that the positive plate.

Still nothing is happening.
Let’s connect the second plate to the battery too. It’s going on the negative terminal, so we’ll call it the negative plate.

Okay! In this first tiny fraction of a second, one of the electrons has got sucked away from the positive plate. Since electrons are negative, losing one makes the plate positively charged.
While that’s happened, an electron has zipped out of the battery’s negative side and landed in the negative plate. Since it’s gained that negative electron, it’s now negatively charged.
Why is this happening? Well, the particles that make up an atom react to each other in the same way that the ends of a magnet do. Opposites attract each other, and sames repel each other.

In this context, this kind of inanimate heterosexuality isn’t called magnetism, but “Coulomb forces”. It’s not limited to happening within one atom, either, or even within one piece of material. All electrons and all protons in a given area are effecting each other, and the closer they are, the stronger the effect.
The two plates of a capacitor are placed close to each other to deliberately take advantage of this. Since they’re identical, but on opposing sides, they naturally want to mirror each other’s behavior. One loses an electron and becomes positive, then the other must gain an electron and become negative.

This process will repeat until we end up with this:

Now that one side of the capacitor is fully positive charged (no spare electrons), no more can enter the negative side either. Since it's full, and the dielectric layer prevents any electron travel between them, then the flow of power stops.
So what can it do?
Let's get rid of that battery, and put the charged capacitor into a simple circuit of it’s own:

Notice those two bare wires, almost touching? let’s flip the switch and see what happens.

ZAP! We got a spark!
But only a fraction of a second later, nothing again:

Why did this happen? Well, think back to the structure of the atom, with it's Protons, Neutrons, and Electrons. If you count them, you find that there's naturally an equal number of Electrons and Protons. That means that an Atom is naturally electrically neutral - the Coulomb forces within it are balanced.
Now when we charge a capacitor plate positively, we're removing Electrons from the atoms that make it up. Those atoms now have more Protons they do Electrons. The electron attracting forces are going to be very strong indeed.

It's the same on the Negative plate. There's this excess of Electrons on each atom, which means their repulsive force between each other is stronger than the attractive force between them and the Protons. So those extra electrons are going to try and escape the first chance they get.

Think of it as like squashing a spring in a clamp. You feel it resist your efforts as you do so. What happens when you let go of the clamp? The spring goes back to original size so quickly that it can shoot your eye out.
It's the same with the charge stored in a capacitor. If it's a big enough cap, the release of energy will be strong and fast enough to overcome the resistance of the air itself. When we see an electric spark, that's the air becoming white hot from the power flowing through.
A recap, and, what next?
So now we understand that a capacitor is a device that stores electrical power, and it does this by disturbing the natural distribution of electrons across it's two halves. We know that the natural forces that govern them are against this, and will try to reverse what we've done. We know that it's this which causes the capacitor to discharge itself whenever given the opportunity.
This is all well and good, but we don't see electrons and protons on our workbench. We see components, and we need to know how to put them to use properly! We need to know what kinds of capacitor there are, how they are sized, and how to choose the right one!
So join me next time for Electronics From Scratch Part 6 - Actually using a capacitor in our Circuit!
I need your help!
Electronics From Scratch is a side project I do around my super low paid retail job. I recently stopped being legally homeless (I have social housing now!), which means I'll be paying for appliances, furniture, carpets etc for the forseeable future.
So, if you would like to see Electronics From Scratch continue, please give a tip at Ko-fi!! I'm going to need to start building real life prototypes soon, and that's going to need some money!