Reposting my replies from philmug:
FACTORY UNLOCKED is a misnomer. By definition, it should have been "NEVER LOCKED" iPhones since those units were actually NEVER locked, either at the factory or by Apple. Literally speaking, no iPhones are being unlocked at the factory level. Instead, unlocked iPhones simply means their serial/model number combo are NOT included in the list of serial/model numbers that are locked to a certain carrier, or CARRIER LOCKED iPhones, which is kept at the Apple servers.
Both factory unlocked and carrier locked units still need to be activated via iTunes connected to Apple's servers prior to first use. This process is what determines if the iPhone is carrier locked or not. If it's in the clean list, then it activates whatever SIM is inserted at the time of activation. If it's carrier locked, it activates too provided a correct SIM is inserted at the time of activation. There is no unlocking done at the factory at all. And there is no difference between unlocked and carrier locked units in terms of features.
In the case of carriers that offer unlocking, like in Australia, their iPhones are initially carrier locked, meaning the serial/model number combo is still in the Carrier Locked list at Apple servers. Now, if the customer wants his iPhone unlocked, usually for a fee, the only thing the carrier needs to do is send a request at Apple to remove the serial/model number from the list. Then it will now be "unlocked". From this moment on, no matter how many times you update the iPhone, it will now just activate regardless of the SIM that is inserted.
If you are not sure that the iPhone you are buying is "NEVER LOCKED", tell the seller to restore the firmware to OFW and then test your Smart or Sun SIM on it. If it activates with your SIM in it, then the iPhone is "NEVER LOCKED". Another way is by looking at the Model number as I described
here
3G and 3GS unlocking is basically still the same. Before they are endorsed to you or given to you by the carrier that offers official unlocking, before it's even unsealed, it's already locked to that carrier (serial/model combo) otherwise the carrier wouldn't offer official unlocking in the first place. It will be very expensive if the carrier locking is done at the factory level.
In the case of 2G, it's easier. Since all 2G were only sold in the US, all serial/model numbers are carrier locked, to AT&T. So it was just a matter of being activated or not.
I guess it's safe to say that there should have been 3 kinds of officially called iPhone units;
Never Locked,
Carrier Unlocked, and
Carrier Locked hehehe. Although
Carrier Unlocked is basically the same as
Never locked once the serial/model number is removed from the Locked list at the Apple server.