Hmm.. I have a hard time imagining how exactly this would work. The unlock is controlled by Apple, so how would your phone automatically switch between locked and unlocked based on geography? Sounds implausible.
Actually, it's easy. The phone has to talk to the cell towers to communicate anyway. All Apple needs to know is the carriers in each country and respond accordingly.
So it doesn't need to use GPS or any fancy method. It already has to get identifying info from the cell towers, so it just uses that. So if it's a Verizon phone, it won't talk to a AT&T sim/tower, but it would to any international cell tower/sim outside the US.