You can expect this form universally for any small perturbation to a stable equilibrium. The reason is that any smooth energy minimum, regardless of its shape, looks like a parabola up close. This can be shown from a Taylor series expansion of the energy $U$ around the equilibrium point:
$$U(0+x)=U(0)+U^{\prime}(0)x+\frac{1}{2}U^{\prime\prime}(0)x^2+\cdots\approx \frac{1}{2}U^{\prime\prime}(0)x^2,$$
where the prime notation indicates derivatives, where $U(0)$ is taken as zero (an arbitrary reference point), where $U^\prime(0)=0$ because we're describing perturbations around a minimum, and where I've dropped all subsequent terms as negligible. Here, $U^{\prime\prime}(0)$ represents a single number: the curvature of the energy well at its minimum. Thus, $$U(x)\propto\frac{1}{2}x^2,$$ the form you were asking about.
In turn, this allows us to define all kinds of useful laws involving generalized restoring forces relying linearly—up to a point—on generalized displacements.
One example is $F=kx$ for springs, a customized version of Hooke's Law $\sigma=E\varepsilon$ in which the generalized force is the actual force $F$ and the generalized displacement is the actual displacement $x$. The strain energy is $dU=F\,dx$, which is integrated to obtain $U=\frac{1}{2}kx^2$.
(Equivalently, since energies are derivatives of forces, one could have worked backward from $U\propto\frac{1}{2}x^2$ as justified above to obtain $F=E^\prime\propto x$, the spring law.)
Another example is $V=IZ$, complex Ohm's Law, where the generalized force is the voltage and the generalized displacement is the current (rate of flow of charge $Q$). The impedance $Z$ in an LC circuit is related to $L$ and $C$, and ultimately we find that the total energy is $U=\frac{1}{2}CV^2+\frac{1}{2}LI^2$, which can be transformed into your expression using the relationships between time-dependent voltage and current at the resonant oscillation frequency $\omega_0=\frac{1}{\sqrt{LC}}$.