Indeed, they're not. The four-letter ICAO station codes
are used, amongst other purposes, as part of addresses on the AFTN (Aeronautical Fixed Telecomms Network) which is essentially a private telex service for exchanging flight plan and other data.
Historically - presumably related to the provisioning of the network - principal stations shared the third character with their subordinates. While this is no longer a rule there its effects can still be seen - for example, Heathrow is EGLL, Blackbushe EGLK; Stansted EGSS, Cambridge EGSC; all Scottish non-military stations are EGPx or EGEx.
Code allocation seems to have been vaguely mnemonic at times (EGLL for London [heathrow]; EGKK = gatwicK; EGBB = Birmingham; EGFF = cardiFF) but was not always possible (EGCC = Manchester).
New airfields, at least in the UK, can opt to choose their own identifier, such as Little Gransden - owned by one M. Jeffries - which became EGMJ.