You can buy mobile phones unlocked (sim free) or locked to a service provider such as Vodafone, Three, EE etc,
Usually when you buy a new phone outright you will buy it sim free so you can choose the provider you want for your sim card, either PAYG or contract.
When you get a phone on monthly contract it is usually locked to the provider that supplied the phone.
I prefer to buy my phone outright and get a one month rolling SIM card. It works out much cheaper that way.