Why do we need a capacitor to store energy when we already have a battery to do that?
It is because a capacitor can provide the stored energy back relatively quickly.
A capacitor is used to store energy just like a battery. But a battery has energy stored in form of chemical energy and a capacitor has the energy stored as electrical energy. So, a capacitor can provide energy really quickly compared to a battery.