Capacitors are some of the simplest and easiest components to use…
… until you plug them in backwards!
Basically, a capacitor is like a gas tank that can be filled with charge or electrons. In case of a gas tank you apply pressure to the air to force it into the tank, and if you try to remove the pressure, the gas tank will force the air out creating pressure and therefore there is a resistance towards the change of pressure.
Similarly, the electrons are forced into the capacitor by applying voltage and if you try to change the voltage, the capacitor will force its own voltage out and therefore there is a resistance towards the change of voltage. That’s why capacitors are mainly used in filtering circuits as well as to store energy.
There are many different types of capacitors. Many of them have polarity, like tantalum and electrolytic capacitors, and many don’t have polarity like ceramic capacitors.
The polarity means that one must make sure that the capacitor is correctly connected such that the voltage on the positive pin of the capacitor is always higher than the negative pin. Or else, you saw what happened in the video!
The capacitor in the video was an electrolytic capacitor. This type tends to explode. Because when used wrongly, the capacitor heats up and the material inside the case vaporises and the pressure builds inside the case, big enough to explode. On top of the case of newer and usually larger capacitors they often create grooves so that if the pressure builds inside the case for any reason, the grooves crack and let the pressure out to avoid explosion.
Tantalum capacitors on the other hand burst into some wild flames. So in either case, be careful!