A capacitor is a passive two-terminal electrical component that stores energy electrostatically in an electric field, functioning similarly to a bucket that holds water. Invented in the 18th century, capacitors are used in various applications, such as tuning radio frequencies, and come in multiple types and sizes, including ceramic, mica, film, and electrolytic capacitors. Unlike batteries, capacitors do not generate electrons and can block direct current while allowing alternating current to flow.