Around the 18th century when figures like Alessandro Volta, Benjamin Franklin, Michael Faraday, and their assistants were experimenting with electricty for no real reason other than to play around with it, two scientists--Ewald George von Kleist of Germany and Pieter van Muschenbroeck of The Netherlands--independently came up with what they believed was a method to capture electricity into some kind of storage medium (displayed in the picture to the right). They would use an electrostatic generator (a ball of sulphur to which friction is applied to free electric charge) and the charge would move through the bar and into the glass jar which was filled with water and held at the bottom. The scientists of the day conceived of electricity as a kind of fluid, and the device would extract the fluid and deposit it in the water--which is not an entirely correct formulation of how electricity works but it led to a moment of serendipity. After the electrostatic generator freed some charge to divert into the bottle (the charge was lead into the water through a wire or a chain), von Kleist grabbed the wire to lift it out of the jar; he immediately received a shock of electricity when he did so. Von Kleist described the experience as such: "If while it is electrified I put my finger or a piece of gold which I hold in my hand to the nail, I receive a shock which stuns my arms and shoulders." When Muschenbroeck had the same experience during his experiments, he said, "I felt myself struck into my arms, shoulders and breast. I lost my breath, and it was two days before I recovered from the effects of the blow and terror. I would not take a second shock for the Kingdom of France."
Von Kleist and Muschenbroeck, morbidly fascinated with this pain generator they had accidentally created, set to work figuring it out. Von Kleist created a Kleist Jar (after von Kleist's own name) and Muschenbroek created a Leyden Jar (named after Muschenbroeck's birthplace, Leyden, a city in the Netherlands). The jars were very similar; they consisted of a glass bottle with the inside and the outside wrapped about halfway up to the neck of the jar with tin foil. A cork or wood lid covered the jar and a brass nail, to which a chain was connected, would be driven through the top with the chain made to touch the inner foil. Viewed from the lens of modernity, we can recognize the brass nail, chain, and inner foil as the cathode, and the foil outside the jar as the anode. For a while after it was discovered, the Leyden jar was reportedly used as a fun parlor trick where onlookers could come and be powerfully shocked. However, the Leyden jar would soon become the first instrument of serious scientific research into electricity because it was able to readily and consistently provide large amounts of electric charge needed for experiments. So if you've ever wondered why one would make a capacitor to provide charge when a battery would seem superior, well, that is because the capacitor has been an instrumental part of the study of electricity since its birth. Also, the capacitor (invented in 1745, called the "condenser" in those days) has been around for much longer than the battery (invented in 1799). Thus while it seems somewhat limited in use these days, as compared with more exciting components such as the transistor, it is historically quite important. It can also provide much more charge much quicker than a battery.
The capacitors of today are not much different than the Leyden jar. Like the Leyden jar, they're just two conducting surfaces seperated by air, a vacuum, or a dielectric. The capacitance of any capacitor is defined as the amount of charge needed to produce a certain amount of voltage across the plates; or,
C = Q/ΔVFor a parallel plate capacitor, the capacitance is given by
C = κε0A/dWhere κ is the relative permittivity of the dielectric between the plates, ε0 is the permittivity of free space, A is the area of the plates, and d is the distance between the two.
The unit of capacitance is the Farad, with units of 1 C/V, named after famous and profilic electrical experimental scientist Michael Faraday.