A capacitor contains electrodes, which consist of two metal plates or metal films that face each other. An insulator (or a dielectric substance), which can be made of various materials, is placed between the electrodes. (In the diagram, air acts as an insulator.)
When voltage is applied to both electrodes by connecting the positive and negative terminals of a battery, the facing electrodes will become positively and negatively charged.
The electric charges will remain even after the power source has been disconnected, as the capacitor has a charging effect. When the electrodes of a charged capacitor are shorted, there will be a momentary flow of current, and the stored charge will become neutralized and disappear. Thus, the capacitor is discharged. Read more Function of Capacitor