A capacitor is a device that stores electrical energy in an electric field.
It is a passive electric component with two terminals
Condenser
The condenser is an older word for a capacitor.
In fact, the term is a misnomer.
The first types of capacitors were built in the 1700s, and people at the time thought that electric current was like a fluid and that capacitors stored charges by condensing the fluid.
Explanation
The capacitor was initially called a condenser.
The capacitor absorbs a good amount of voltage at low electric pressure just like the condenser.
The process of water vapor being reconverted into a liquid state is called condensation, similarly, the electric charge stored in the battery, when transmitted to a capacitor, will be condensed into an electric field.
When positive and negative charges coalesce on the capacitor plates, the capacitor becomes charged. A capacitor can retain its electric field because the positive and negative charges on each of the plates attract each other but never reach each other.
So condenser was the old name for the capacitor.
Thus, the term 'condenser' was used because it was supposed to condense electric charges.