Origins
The conjunction 'but' is one of the most common words in English, used thousands of times daily to introduce contrast, exception, and opposition.βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Its etymology reveals that this abstract logical function grew from a concrete spatial concept: 'but' literally means 'by-outside.'
The word descends from Old English 'bΕ«tan' (without, outside, except, unless), a compound of 'be-' (by, near) and 'Ε«tan' (outside, from without), itself derived from 'Ε«t' (out). The original meaning was purely spatial: 'bΕ«tan' meant 'on the outside of, outside.' From this spatial sense developed the exceptive meaning: if something is 'outside' a group, it is excepted from it. 'All bΕ«tan one' meant 'all, with one on the outside' β hence 'all except one.' This exceptive sense is still alive in Modern English: 'nothing but the truth' means 'nothing except the truth,' and 'all but finished' means 'all except finished.'
The adversative use β 'I tried, but I failed' β developed from the exceptive sense during the Middle English period. The logical path is: 'everything is true except this' becomes 'this, however, is different.' The word shifted from marking what lies outside a set to marking what contradicts an expectation. This is a common pathway of semantic change: spatial terms for 'outside' or 'aside from' regularly become adversative conjunctions in the world's languages.