The YYZ code for Toronto Pearson airport originates in the two-digit YZ location identifier assigned to Malton Airport, the airfield’s original name, in the late 1930s and early 40s.
Most airfields and weather stations in the United States, Canada and Alaska, had unique two-letter identities, emitted by beacons as a Morse code radio signal for aeronautical navigation and reporting of weather conditions. Using two letters limited the number of available identifiers to 676 possible unique combinations, and as many US stations were using letters that bore some relation to their location, the range of unique location-related letter combinations available for Canadian airfields was limited. Canada, therefore, tended to use combinations that started with letters towards the end of the alphabet, with Q, X, and Y commonly used.
After World War II, IATA mandated the use of three-letter airport codes. Rather than assign completely new codes, in most cases, Canada had a Y prefix added to existing two-letter codes, hence the continued use today of YYZ as the identifier for Toronto Pearson International Airport.