The word 'can' — expressing ability and possibility — is secretly a verb of knowledge. It descends from Old English 'cunnan' (to know, to know how to, to be able to), from Proto-Germanic *kunnaną (to know), from PIE *ǵneh₃- (to know, to recognize). When you say 'I can swim,' you are etymologically saying 'I know [how to] swim.'
The semantic shift from knowledge to ability is natural and well-attested across languages: to know how to do something implies being able to do it. German preserves both stages of the evolution: 'kennen' means 'to know' (a person or thing, from the same root) and 'konnen' means 'to be able to' (the ability sense that English 'can' now exclusively carries). English collapsed both meanings into 'can' while 'know' (from the same PIE root, but through a different Germanic formation with an n-prefix) took over the pure knowledge sense.
Old English 'cunnan' was a preterite-present verb — a class of verbs whose present tense forms were originally past tense forms of strong verbs. This explains the unusual grammar of 'can': it takes no '-s' in the third person ('she can,' not 'she cans'), has no infinitive ('to can' is ungrammatical), and forms its past tense 'could' with a vowel change rather than a '-d' suffix. These are all traces of its ancient irregular conjugation.
The PIE root *ǵneh₃- is one of the most prolific roots in the entire Indo-European family. Through Latin 'cognōscere' (to come to know — co + gnōscere), it gave English 'cognition,' 'recognize,' 'connoisseur' (one who knows), 'acquaint' (to make known to), and 'reconnaissance' (a getting-to-know). Through Greek 'gignṓskō' (γιγνώσκω, I know), it gave 'diagnosis' (a knowing-through, a discerning), 'prognosis' (a knowing-before), and 'gnosis' (knowledge, especially mystical knowledge). Through Latin 'nōbilis' (well-known,
The English relatives within Germanic are equally fascinating. 'Cunning' originally meant 'knowing, learned' (it became pejorative only later — crafty knowledge became sly knowledge). 'Ken' (to know, as in Scottish 'I dinna ken') preserves the original meaning directly. 'Uncouth' is 'un-couth' — 'unknown,' from Old English 'uncūþ,' where 'cūþ' (known, familiar) is the past participle of 'cunnan.' 'Could' is the past tense, from Old English 'cūþe' (knew how to), with the 'l' inserted by analogy