The basic function of a capacitor
The process of electrifying a capacitor (storing charge and electrical energy) is called charging. At this time, the capacitor's two plates are always one plate with a positive charge, the other plate with the same amount of negative charge. When one electrode of a capacitor is connected to the positive electrode of a power source (such as a battery pack) and the other electrode is connected to the negative electrode of a power source, the two electrodes each carry an equal amount of heterogeneous charge. After charging, there is an electric field between the two plates of the capacitor, and the electric energy obtained from the power supply is stored in the capacitor during charging.
The process by which a charged capacitor loses charge (releasing charge and electricity) is called discharge. For example, if a wire is used to connect the two poles of a capacitor, the charges on the two poles will be neutralized and the capacitor will give off charge and electric energy. After discharging, the electric field between the two plates of the capacitor disappears and electrical energy is converted into other forms of energy.
In general electronic circuits, capacitors are often used to realize bypass, coupling, filtering, oscillation, phase shift and waveform transformation, etc. These functions are the evolution of their charging and discharging functions.