Factory-unlocked iPhones (officially unlocked either right out of the box or via a carrier settings update once you've paid the fee to your chosen carrier.
Here in Australia we have four networks selling the iPhone so to have it unlocked you pay your carrier a certain fee, they upload the IMEI number to a central database and when you plug the iPhone into your computer a Carrier Settings Update is downloaded and you're presented with the famous "Congratulations, Your iPhone is now unlocked" screen.