here are two ways to go about fully unlocking an iPhone in order to use it with any carrier and network. A “software unlock” involves extracting the unlock key from the iPhone’s radio chip and then using the unlock command and key to unlock the phone--this is how Apple or AT&T would unlock a phone. There’s also a “hardware unlock,” which uses a Turbo SIM or other methods to unlock the iPhone.
read it here arstechnica