It is an device that is used to store electrical charge
It is similar to battery but the current is stored in a electric field and it can only stored a small amount of charge

They consist of two plates with an insulating (dielectric) material in the middle
When current is passed through an capacitor it causes the electrons to accumulate at one end till its potential becomes same as the battery

Even with the battery removed from the circuit the charge will not be lost from the capacitor

The capacitance of a capacitor is measured in a unit called Farads (F)
There is an Volt rating on the capacitor this shows the maximum voltage that it can handle

It used used in circuits to smooth out the DC current that is converted from the input AC current

What is the purpose of a capacitor? - Quora