How airports get their 3-letter airport codes

I've been traveling a bit in the last year and one of the things that I wonder about airports is where their airport codes come from. Some of them are obvious, like JFK for John F. Kennedy Airport, but others, like MSY for New Orleans' Louis Armstrong International Airport, don't seem to make any sense at all.

Airport codes by Lynn Fisher and Nick Crohn aims to clear all that up. The site lists over 1000 airpots and their 3-letter IATA codes and gives a very brief explanation as to why they use those 3 letters (if it isn't already obvious).

One interesting thing is the added "X" to the ends of formerly 2-letter airport codes. Portland's "PDX" is one example but one airport that doesn't add the "X" is San Francisco's "SFO" which opted for the last "O" in it's city name instead of the usual "X". Cool. :)