late 14c., "state or condition of being able; capacity to do or act," from Old French ableté "ability (to inherit)," from Latin habilitatem (nominative habilitas, in Medieval Latin abilitas) "aptitude, ability," noun of quality from habilis "easy to manage, handy" (see able). One case where a Latin silent -h- failed to make a return in English (despite efforts of 16c.-17c. scholars); see H. Also in Middle English, "suitableness, fitness." Abilities "one's talents or mental endowments" is from 1580s.
early 15c., "ability to contain; size, extent;" also "ability" in a legal, moral, or intellectual sense, from Old French capacité "ability to hold" (15c.), from Latin capacitatem (nominative capacitas) "breadth, capacity, capability of holding much," noun of state from capax (genitive capacis) "able to hold much," from capere "to take" (from PIE root *kap- "to grasp").
Sense of "power to store electricity" is from 1777; industrial sense of "ability to produce" is from 1931. Meaning "power of containing a certain quantity" is from 1885, hence "largest audience a place can hold" (1908).