These codes are generally assigned using the first three letters of the location's name where the airport is situated.