Two coupled resonant circuits: how the energy of the primary capacitor rings over into the secondary, how coupling and tuning change the voltage and the beat period.
The science
A resonant (air-core) transformer is two tuned circuits. The primary has inductance Lp and capacitor Cp, the secondary has inductance Ls and a small top-load capacitance Cs; the coils share a mutual inductance M = k sqrt(Lp Ls). With currents i1, i2 and capacitor voltages V1, V2 the equations are Lp i1' + M i2' = V1 - Rp i1, M i1' + Ls i2' = -V2 - Rs i2, Cp V1' = -i1, Cs V2' = i2, integrated with RK4. Resonance is w0 = 1/sqrt(Ls Cs); the primary is tuned to it by choosing Cp (the detune slider shifts it).
With coupling k the system has two normal modes at w = w0 / sqrt(1 +- k). Their beating moves the energy from primary to secondary in t = pi / (w_a - w_b) = pi / dw, about 1 / (4 f0 k) for weak coupling. Because the energy 1/2 Cp V0^2 ends up on a tiny capacitance, the ideal secondary voltage is V2 = V0 sqrt(Cp / Cs), hundreds of times the primary voltage; in a real coil the arc starts to lose energy before this and the voltage is limited by corona and breakdown (air fails near 3 MV/m in a uniform field, much less near sharp points).
Simplifications: lumped parameters (a real secondary is a distributed transmission line), no spark gap or switch model, no arc load, constant coupling, only linear resistance for losses. Checks below: energy conservation with zero resistance and the beat time against pi/dw. Educational physics; high voltage is dangerous and this is not a build guide.