Each country has different policies when it comes to unlocking. Locked phones greatly outnumber unlocked ones.
Take Chile, where phones must be legally unlocked by the telco or manufacturer to work WITHIN other operators in the country, but not necessarily abroad.
Buy an "unlocked" phone from a Chilean and you might get stuck with a brick.
The different and complex type of unlocking levels Apple has for its devices (and there are many) are designed to assist the Telco and any countrywide regulatory policies that need to be enforced.
There are many parts to this jigsaw puzzle.