Indeed, what Hi said
Not only that , but codes get reused once freed up such as BR which was the code for British Caledonian and now is code for Eva Air
On top of that there are codes that have numbers in them, such as A8 and B9 and even K9
Some codes do fit in with airline abbreviations and those that got in early may well have had one that nicely matched the airline name