A capacitor stores energy in an electric field and is used to smooth voltage fluctuations or filter signals.