You need to unlock your phone when you are moving from one network to another. Example- You are currently on O2 and moving to EE and you aren’t having a new phone. 


If your phone is locked there are several forms online you can fill in to get the network to unlock your phone:


EE - https://ee.co.uk/help/help-new/getting-started-and-upgrading/unlock-your-phone/unlock-a-ee-device-to-use-with-another-network


Vodafone- https://www.vodafone.co.uk/vodafone-uk/forms/unlock-code-request/


O2 - https://www.o2.co.uk/help/phones-sims-and-devices/unlocking-an-o2-mobile-to-use-on-a-different-network/online-form


If you have a personal account, you should be able to log onto your online portal and request them to unlock. 

You can also call your network and ask them to do this for you.