Locked: The phone can only be used with the contract provider.
If you are getting a "Free phone with sign up or new contract" it is locked.
UNLOCKED: phone can be used with ANY compatable provider.
This means a phone purchased for use with T-Mobile can be switched to AT&T.
Now the problem.. AT&T and T-Mobile both use the same encryption and compression methods.. So the phones can cross over
Sprint uses a different one
I'm not sure what Verizon uses
Some use multiple schemes and once again their phones can cross over.
Some phones are capable of multiple schemes as well.