Do this in a simulator:
1. Remove the resistors, so yo just have a generator and an LC combination.
2. Change the generator to a single step from 0 to 5V.
3. Run simulation and observe the output.
In the beginning you will see only a slow change in current through the inductor. Inductors "resist" change in current.
Some while later, the capacitor is charged to the same 5V as the source. Up to that time the current through the inductor has been increasing.
Because there is still current flowing through the inductor, it will keep on pushing that into the capacitor.
Because the voltage over the capacitor is now higher then the voltage of the source, the current through the inductor will get less again.
By the time the current through the inductor is zero, the capacitor will be charged to twice the voltage of the source.
If the source can also sink current, then the current through the inductor will reverse, and current will flow from the capacitor through the inductor back to the source.
When there is a voltage over a capacitor has energy stored. Likewise, if there is current flowing through an inductor, it has also stored energy.
Without resistors, the energy will keep on exchanging between the capacitor and the inductor, and you will see sinewaves on your simulation, even though the initial input is just a single step.
With a series resistor, there is energy loss, and the sinewave will dampen out.
When you change the single step of the source to a square wave of the right frequency, you will pump a bit of energy into the LC combination during each period, and the output voltage will increase. In and ideal LC combination, the output voltage will be infinite, but in reality there is always some resistive part (such as wire resistance) and the output voltge will stop increasing when the energy dissipated is the same as the energy pumped into the system.