Originally Posted by Ross1874:
“How exactly do these people unlock the phones is it not just through some software program ?”
They generate a unique unlock code for your phone, which is based on the IMEI number and some other information. Each phone knows what it's unlock code is, but you don't know it.
The unlock code is a hash of the IMEI number and some other information which when computed correctly unlocks the device. A hash is just a computational algorithm which usually runs one way and is hard to break in reverse as you don't know what other data was used to create it in the first place eg: there will be a form of 'key'.
The network has access to software to be able to compute the unlock code.
You can also download software to do it, but this can require an element of technical knowledge. Some phones are harder to unlock than others.
It is possible to try and break the hash or for the key to leak, which is why you can get software to unlock phones online.
If the OP said what phones they were I'm sure somebody can advise of how easy or hard it is to unlock.