system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do Tesla coils work?
gpt
Imagine you're pushing a swing. If you push the swing with the right timing, the swing will go higher and higher. When you push the swing, you're store energy in the system. With each push, you add more and more energy.

If you push at the wrong time, the swing system will lose energy as you will be using energy to absorb some of the energy from the swing.

In a Tesla Coil, a similar principle applies. Instead of a swing, you have an inductor and a capacitor, both components which store energy. When you put apply a voltage source across a capacitor, the voltage across the capacitor will take some time to reach the full voltage of the voltage source. 

In the context of a Tesla Coil (at least for one type, we'll get to the other types later) once the voltage across the capacitor is high enough, a spark gap fires and becomes conductive. Once this happens, the energy stored in the capacitor is transferred into an inductor.

The inductor stores energy in a magnetic field (unlike the capacitor, which stores it in an electric field). Once the energy from the capacitor is exhausted, the magnetic field around the inductor begins to collapse, transferring the energy back into the capacitor, and the cycle repeats.

This oscillation is electrical resonance (unlike the swing, which is mechanical resonance). In the case of a Tesla Coil, there are two resonant circuits. The first takes energy from transformers powered by the mains. The second resonant circuit gets it's energy from the expanding and contracting magnetic field around the inductor in the first resonant circuit.

The magnetic field around the inductor in the first resonant circuit is used to induce a current in the inductor in the second resonant circuit, transferring energy into it. The two resonant circuits have their frequencies matched, so this energy being added is just like the swing being pushed; the voltage swings up and down higher and higher with more energy being added. In Tesla Coils, the oscillation is at a high frequency (~100kHz-1MHz), meaning the large voltage swings in the secondary circuit build up very quickly.

As for other types of Tesla Coils, the one I've described is called a Spark Gap Tesla Coil. There are also various types of Solid State Tesla Coils. The simplest of these does away with the primary resonant circuit, and instead feeds a pulse of energy into what was the secondary resonant circuit. This causes a few oscillations, which create radio waves. These radio waves are picked up by an antenna, and amplified and fed back into the resonant circuit. This feedback loop can be interrupted, and by turning an audio signal into a square wave, you can create sound (this is how the musical tesla coils work).

**TL;DR, It's sort of like pushing swings, but electrically.**