A capacitor allows for the very quick release of electrical energy in a way that a battery cannot. For example, the electronic flash of a camera uses a capacitor.