Gizmodo has done a good job tracking down the facts: (Go read the entire thing with updates, please, as I could only snip small bits)
iSpy Conspiracy: Your iPhone Is Secretly Tracking Everywhere You've Been, All The Time (Updated)
http://m.gizmodo.com/5793925/your-iphone-is-secretly-tracking-everywhere-youve-beeniSpy Conspiracy: Your iPhone Is Secretly Tracking Everywhere You've Been, All The Time
--snip--
It turns out that all our iPhones are keeping a record of everywhere you've been since June. This data is stored on your phone (or iPad) and computer, easily available to anyone who gets their hands on it. Updated: 1:33 EST
And now, we're wondering whether the same goes for our other smartphones. The opt-in wording of phone location service agreements is pretty nebulous (as agreements tend to be). --snip-- We've also reached out to Apple and BlackBerry-maker RIM for similar clarifications on data collection, but haven't gotten a response yet.
--snip--
The privacy startle, apparently enabled by this summer's iOS 4 release, was discovered by two security researchers, one of whom claims he was an Apple employee for five years. They're equally puzzled and disturbed by the location collection: "By passively logging your location without your permission, Apple have made it possible for anyone from a jealous spouse to a private investigator to get a detailed picture of your movements," they explain. All it would take to crack the information out of your iOS device is an easy jailbreak. On your computer, the information can be opened as easily as JPEG using the mapping software that the security experts have made for download—Try it yourself.
The data itself is jarringly accurate (most of the time). And even though it appears to rely on tower triangulation rather than GPS pinpointing (meaning you're probably not safe with location services switched off), the map I was able to generate with mapping software the security duo released visualizes my life since the day I bought my iPhone 4 in July. --snip--
For now, there is no fix. The only way to remove it from your computer is to wipe your back up files from your computer.]/b] But then you have no back ups to restore your phone in case you lose it. And every time you sync your computer, though, it'll create a new file. And if you do lose your phone, all your tracking data goes with it, right into the hands of whoever found it. And if you upgrade your phone to the next iPhone, the location tracking history goes with it. For now, the best to keep your location data safe is to encrypt your backup files—but that still leaves the roaming device itself vulnerable.
--snip--
Update 1, 12:48 PM EST: Security expert Kevin Mitnick says he's "Quite shocked and disturbed" by the revelation, noting that the logged data could be of great interest to a variety of entities—prying spouses, private investigators, and, he reckons, the government. He speculates that the existence of the log itself "could have been at the request of the government," as such data "can't be used for advertisements. It seems to me more to be a governmental request." He added, "I like to know what my device is doing." And, that the phone's logging of data was in this case like "carrying around a bug and a tracker at the same time."
Update 2, 3:37 PM EST: Google has declined to comment on the record as to the exact nature of their locational data collection.
Update 3, 5:32 PM EST: Microsoft tells us the only locational data they're storing on your Windows Phone 7 device is your last known location—a single data point that's erased as soon as it stores a new one.
Update 4, 5:50 PM EST: IT security expert Jonathan James has poked around inside the iPhone location database file in question and discovered tables labeled "Harvest" and "HarvestCounts," although their use is still unknown.
Update 5, 1:35 EST: John Gruber's got a reasonable-sounding explanation for the covert tracking: maybe it's just a bug.