Yes, when you use the location services in, say, a new city then your device will download and cache the WiFi location data for a large radius around that initial lookup the next time it has an internet connection. It's pretty cool, actually.
That database isn't infinitely large, as unused location information will be removed as new location data comes in.