Your iPod touch has a database of the MAC addresses and coordinates of many publicly visible WiFi base stations (not necessarily publicly accessible, ie. they may be encrypted -- they just have to be visible) throughout their major customer markets. The database was originally provided by two subcontractors -- Skyhook and Google -- but in iOS 3.2 and above, Apple maintains the database themselves.
Basically, Apple uses its own user base to create a self-correcting database:
1) A user with a GPS-enabled iOS device uses an App than turns on Core Location services. IF THE USER LEAVES CORE LOCATION TURNED OFF, THEN NONE OF THIS HAPPENS.
2) The device automatically uses GPS to determine your location. It may use additional information such as nearby cell towers and WiFi access points that are already in its database to speed up the lock. Core Location returns this information to the App, and as far as the user is concerned, the whole process is complete.
3) BUT, behind the scenes, the device also silently scans for nearby WiFi access points and cell towers.
4) The device checks to see if those WiFi access points and cell towers are already known in its database.
5) If not, or if the existing database entry for that tower or access point is significantly incorrect based upon the known GPS coordinates, the device "phones home" (perhaps the next time the device synchronizes with iTunes) to inform Apple's central server about the true locations of any access points and towers it has recently discovered.
6) Apple's central servers process the information to produce a new version of its location database -- this revised information will subsequently by distributed out to all iOS-based devices.
7) The user of an iOS device without GPS (such as an iPod touch or a WiFi-only iPad) uses an App than turns on Core Location services. It uses the most recently synchronized database, furnished by its GPS-enabled iOS counterparts, to look up any nearby WiFi access points, and if there is enough information, it attempts to triangulate an estimate of the device's present location.