Capacitors and inductors are capable of storing energy in the electric field and magnetic field respectively.
No A.C elements i.e., capacitor, inductor are pure. In other words each of them do have some resistance. The charges or current through these elements lose their energy as heat due to the resistance. The energy is radiated away in form of electromagnetic wave, which is the basis of radio, T.V transmission. As the circuits give away this energy, this loss has to be replenished. This is done using a L.C circuit. Consider the circuit below:
The capacitor, which charged, is connected to the indicator. The capacitor starts discharging i.e., the charges on capacitor start decreasing. If q and I were the charge and current then according to Kirchoff’s Law.
(i.e., e.m.f across C = e.m.f across L)
The solution for the above equation being
i.e, the charge and hence current is oscillatory. This means its magnitude and direction keeps changing. The charge on the capacitors going through the inductor generates a magnetic field and thereby some energy is stored in the magnetic field. The current slowly reaches a maximum when the capacitor is fully discharged. The induced current in the inductor opposes this and charges the capacitor in opposite direction.
The whole process repeats once again. The energy of system oscillates between capacitor and the inductor.