In Apple’s explanation of why they kept a log of locations where your phone had been, they also explain how they use crowd-sourcing to allow iPhones to rapidly ascertain their location:
The iPhone is not logging your location. Rather, it’s maintaining a database of Wi-Fi hotspots and cell towers around your current location, some of which may be located more than one hundred miles away from your iPhone, to help your iPhone rapidly and accurately calculate its location when requested. Calculating a phone’s location using just GPS satellite data can take up to several minutes. iPhone can reduce this time to just a few seconds by using Wi-Fi hotspot and cell tower data to quickly find GPS satellites, and even triangulate its location using just Wi-Fi hotspot and cell tower data when GPS is not available (such as indoors or in basements). 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.
This technology seems really, really cool to me. I knew that Apple had a database of wifi hotspots that they used to determine where an iPhone is located without using GPS, but I didn’t realize that they were building the database using data uploaded from those phones.
As far as the location log goes, some programmer created the log but never bothered to scrub or rotate it. Been there, done that.