Apple says [0]: "These calculations are performed live on the iPhone using a crowd-sourced database of Wi-Fi hotspot and cell tower data that is generated by tens of millions of iPhones sending the geo-tagged locations of nearby Wi-Fi hotspots and cell towers in an anonymous and encrypted form to Apple."
The phone uses a local database of wifi locations to help triangulate on-device. Separately, the locations of wifi APs are uploaded to apple to maintain the database, but the source of the data is not saved, just the location of the WAP. A subset of the database is cached on-device.
They tried to clear this up in a 2011 press release but of course it just comes down to trusting it works the way apple says it does:
The phone uses a local database of wifi locations to help triangulate on-device. Separately, the locations of wifi APs are uploaded to apple to maintain the database, but the source of the data is not saved, just the location of the WAP. A subset of the database is cached on-device.
They tried to clear this up in a 2011 press release but of course it just comes down to trusting it works the way apple says it does:
[0] https://www.apple.com/newsroom/2011/04/27Apple-Q-A-on-Locati...