All iPhones from the 3G model onwards and 3G iPads have what is known as
assisted GPS or A-GPS and this works in several ways. Firstly it uses phone
mast triangulation and Wi-Fi hotspots to obtain a quick and dirty fix on
your location, normally to within a kilometre or less, depending on the
area. This is then used to help speed up the acquisition of GPS satellite
signals, to provide a more accurate position, this time to within a few tens
of metres. The GPS function does work without a network connection but it
can take a minute or more for it to lock on to the satellites and work out
your position.
The network connection is also used to update map information and provide
extra detail, though clearly you are not too worried about finding the
nearest McDonalds or Post Office bobbing around on the North Sea. As a
matter of interest iPhones and iPads send details of your location to Apple.
This is used to maintain a crowd-sourced database of phone masts and Wi-Fi
hotspots, which is supposed to help refine the initial location fix. Apple
is keen to make it clear that this information is encrypted and anonymous,
though a bug discovered in 2011, now fixed, revealed that an unencrypted
file on iPhones stored a year’s worth of time-stamped location data. This
data is still retained, but now only for 7 days.