I buy my iPhones, and the first time they sync, I get the message, "Congratulations, your phone is unlocked."
As it stands, AT&T owns your iPhone until you finish your contract just like the dealer owns your leased car.
In Australia, subsidised androids on 2 year plans aren't locked at all, and for iPhone its as simple as ringing the carrier for the unlock code, you can do it the day you get your phone.
They're going to get the full value of the contract anyway, why pay them insane roaming fees too.
It used to be worse. They used to come locked, and getting unlocked was an exercise in pulling teeth. Thankfully things are better now.
To those that say it's a lease, it's not: you cannot give the phone back and receive the money you've paid for it. It is your handset. You cannot even request a new one if it doesn't suit you (here in Australia anyway). Unlocking the phone does not cancel the contract: you still pay that monthly fee.