iDevices utilize a Carrier Settings file (
http://support.apple.com/kb/HT1970?viewlocale=en_US&locale=en_US ) to configure specific carrier settings such as APNs (access point names) for Visual Voicemail, SMS, MMS, internet access, tethering, and presumably FaceTime over 3G.
I would imagine that network identification occurs when the iDevice connects/registers with the network. At that point the specific carrier file is used. If it isn't an official or supported iPhone carrier, the device uses a generic carrier file that allows you to access the Cellular Data Network settings so you can configure your own APNs.
I don't use StraightTalk so I'm not sure if there is a specific carrier file for them since they are an AT&T MVNO. My iPhone is on T-Mobile ($30 for 100 minutes talk/unlimited text/5 GB data) and it appears to be using a generic carrier file called Carrier 12.2. You can check yours under Settings>General>About>Carrier. My AT&T iPad with $30 unlimited data plan is using the AT&T 12.5.2 carrier file.
-ITG