xtotheizo,
My personal understanding is GSM phones don't keep a record of what towers are available per se. What it does is keep track of is GSM towers it can receive a signal from, and as long as it is getting what appears to be good signal from a given cell, it will stay connected to that cell. When it first communicates with the tower it passes along some information, and the tower verifies with the carriers if that phone is allowed on that tower. In addition, if the tower identifies itself as being outside your home area, the iPhone will turn off data (EDGE) if you have set data roaming to off.
Turning airplane mode on for 30 seconds, or reseting the iPhone forces it to look for towers in the area again, and try to authenticate with the network again. When it authenticates, the carrier determines if you are allowed to use that tower at all or not. Authentication does occur over the air, and is based on the ICCID number stored on the SIM card.
Hope this helps,
Nathan C.