There is a large coil spring which stores the energy. That spring exerts a force which is approximately $F = kx$ where $x$ is the extension of the spring: this is Hooke's law. The energy stored in the spring at extension $X$ is thus
$$
\begin{split}
E &= \int\limits_0^X F(x)\,dx\\
&= \int\limits_0^X kx\,dx\\
&= k\frac{X^2}{2}
\end{split}
$$
Where $X$ is the extension.
The energy needed to raise the mass by some height $h$ is $mgh$. The pulley at the end of the spring has a variable diameter (this is the critical thing that makes a system like this work) such that
$$
\frac{kx}{2mg} = h
$$
And if you get everything adjusted correctly this means the mass will just sit at any point. The spring has a rate adjustment, which essentially alters $k$, and he also adjusts $m$ by adding & removing a reel of tape to the mass.
Another way of thinking about this is to do so in terms of forces directly. The force exerted by the spring is $F_s = kx$, and $k$ is the spring constant. The force exerted by the mass is $F_m = mg$, which is a constant. So if we just connect the spring and the mass by a bit of string, then the system will sit at equilibrium when $F_s = F_m$, or $kx = mg$, or $x = mg/k$. And it's easy to see that the motion around this equilibrium will be simple harmonic.
So if you want the mass to be able to sit anywhere you need some kind of mechanism which causes the spring to exert a constant force. Well, there are things called 'constant force springs' which do this, but they are typically not things like coil springs, but rather tapes which wrap around a shaft. But if you can construct some device with mechanical advantage which varies with $x$, then you can turn a coil spring into a constant force spring.
A very traditional way of doing this is a device called a fusée: these are devices with a tapered pulley around which some kind of cord or chain is wrapped, and they were very widely used in clocks & watches, whose rate can depend on the tension in the spring (a better solution for clocks is to make the escapement's rate not depend on the spring tension).
Another way is to have two concentric pulleys which are attached to each other: the spring pulls on a string which is wrapped around one of them, and the mass pulls on a string which is wrapped around the other. If you make one or both of the pulleys of varying diameter, then so long as they rotate by less than one turn, you can arrange things so that the mechanical advantage changes as the pulleys rotate. That's what is being done here: it's a pretty solution.