There is tons of information about jail-breaking and unlocking iPhones on the net. For greater detail, google the terms.
Jail-breaking and unlocking iPhones allows the user to use the device with a different cellular telephone carrier. Jail-breaking the phone requires the user to tether the phone to a computer every time the phone is cycled on an off. Unlocking on the other hand, does not require tethering. Apple produces iPhones that come factory unlocked. I have a 3GS iPhone that is unlocked and I use it while overseas to eliminate roaming charges. Suffice to say, if you had bought an iPhone at an AT&T store and unlocked it, you could use a SIM card from a different carrier to provide your service. Also, there are other non-iTunes store apps available via Cydia.
As I said upfront, there is tons of data available on unlocking iPhones. Just google the terms.