When your iPhone gets activated, it gets locked. The iPhones are unlocked in their box. The Apple Stores may have different shelves for ones they plan to sell as contract and ones as unlocked, but there's nothing different between them.
Exactly. The SIM lock is applied when the phone is activated, according to whichever network the phone was sold on.