The strange way airports get their call signs

Every airport has its own specific three-letter code. Phoenix Sky Harbor Airport is PHX, for example, and Denver International Airport is DEN. It turns out that the way these codes are assigned is much more complicated than just abbreviating the city or state. If you fly to Montreal, Canada the call sign is YUL. Why is this and how does the system work?

Tags: code, codes