UPDATE 21.04.11: Wired has some information on this: http://www.wired.com/gadgetlab/2011/04/apple-iphone-tracking/
So I saw a link to this website on Apple keeping location data on iPhones the other day, and thought it was very interesting (http://petewarden.github.com/iPhoneTracker/). As I started thinking about it though, I remembered that the locations based on Wifi on the iPad also seemed to be pretty good, and I wondered if Apple was storing that information as well. So using the code here (http://stackoverflow.com/questions/3085153/how-to-parse-the-manifest-mbdb-file-in-an-ios-4-0-itunes-backup) to figure out what file was the database, and the other suggestions mentioned by the site, I did some digging into my iPad backup, and lo-behold there is a Table called "WifiLocation", with fields of "MAC", "Timestamp", "Latitude", "Longitude", etc. So I punched some of the Lat-Long coordinates into Google Maps, and although some seemed to be off (i.e. I don't remember being in that location) some of them were definitely right on, actually showing my apartment building.
So not only are they storing the location using Cell towers (and maybe GPS, there is another table called "Location"), they are also storing it based on Wifi. This does not seem like a good thing. I mean location services are great, but why does my iPad need a database of past locations?
I don't know how good many of the locations are, and what exactly is going on as there are multiple entries for any given timestamp. Unfortunately, I won't have time to try and work on this until after next Friday. Maybe someone else will have it all figured out by then.
EDIT: For Windows users (everything above I did in Linux), I have also just found out about this http://code.google.com/p/iphonebackupbrowser/, combining it with an SQLite browser should allow you to see what information is being stored on your iPhone or iPad. I haven't gotten it working yet, but have no reason to suspect it won't.