mid-15c., inhabilite, "disqualification for office," from in- (1) + ability. Earlier was unability "incapability; incompetence" (late 14c.). General sense "state of being unable" is recorded by c. 1500.
word-forming element meaning "not, opposite of, without" (also im-, il-, ir- by assimilation of -n- with following consonant, a tendency which began in later Latin), from Latin in- "not," cognate with Greek an-, Old English un-, all from PIE root *ne- "not."
In Old French and Middle English often en-, but most of these forms have not survived in Modern English, and the few that do (enemy, for instance) no longer are felt as negative. The rule of thumb in English has been to use in- with obviously Latin elements, un- with native or nativized ones.
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.
<a href="https://www.etymonline.com/word/inability">Etymology of inability by etymonline</a>
Harper, D. (n.d.). Etymology of inability. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/inability