A capacitor is a device that stores electrical charge by creating an electric field between two conducting plates separated by an insulator. When a capacitor is connected to a battery, electrons flow from one plate to the other, building up equal and opposite charges. The amount of charge a capacitor can store is defined by its capacitance. The energy stored in a charged capacitor depends on the capacitance and the voltage applied.