"mental capacity," Old English wit, witt, more commonly gewit "understanding, intellect, sense; knowledge, consciousness, conscience," from Proto-Germanic *wit- (source also of Old Saxon wit, Old Norse vit, Danish vid, Swedish vett, Old Frisian wit, Old High German wizzi "knowledge, understanding, intelligence, mind," German Witz "wit, witticism, joke," Gothic unwiti "ignorance"), from PIE root *weid- "to see," metaphorically "to know." Related to Old English witan "to know" (source of wit (v.)).
Meaning "ability to connect ideas and express them in an amusing way" is first recorded 1540s; that of "person of wit or learning" is from late 15c. For nuances of usage, see humor (n.). Witjar was old slang (18c.) for "head, skull." Witling (1690s) was "a pretender to wit."
A witty saying proves nothing. [Voltaire, Diner du Comte de Boulainvilliers]
Wit ought to be five or six degrees above the ideas that form the intelligence of an audience. [Stendhal, "Life of Henry Brulard"]