There are two types of airport codes - three-letter IATA codes (for passenger handling) and four-letter ICAO codes (for air traffic).
The convention adopted in the USA and Canada is that IATA codes are created by taking the ICAO code and chopping off the first letter (C for Canada, K for the USA) - thus ICAO KEWR becomes IATA EWR, ICAO CYOW becomes IATA YOW, etc. (So it's not a case of adding a K for weather stations, it's a case of chopping off the K to turn the ICAO code into an IATA code!).
In Europe IATA and ICAO codes are normally unrelated. LHR is EGLL, FRA is EDDF, CDG is LFPG. The first two letters of the ICAO code denote the country - or, to be totally pedantic, the first letter denotes the region and the second one is the country. E is Northern Europe (hence EG for the UK, EB for Belgium, ED for Germany), L is Southern Europe (LF for France, LI for Italy). The USA has all of K, Canada is CU to CZ (though most airports are in the CY block)