Technically - the process is called trilateration and operates by cross checking all BSSID - the unique identifier / MAC address for each wireless base station that your Mac can detect while it listens periodically or is actively searching to join a WiFi channel.
You can run this scan manually by running the Wireless Diagnostic app which is located in /system/Library/CoreServices/Applications on Mavericks.
As long as your hardware is within range of one hot spot that has been geolocated in Apple's database of hotspots, the location should be within one football field of the location of the hotspot.
With three or more measurements - and relative signal strength of the various hot spot radio signals - the program might be able to make a more accurate estimate of your location.
You can also run this scan from the command line using the
airport binary that is squirreled away in
mac:bin mike$ airport --scan
SSID BSSID RSSI CHANNEL HT CC SECURITY (auth/unicast/group)
na ala hele 00:26:36:9c:32:23 -59 2 Y US WPA(PSK/TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP)
na ala hele 00:26:bb:79:23:1f -59 2 Y US WPA(PSK/TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP)
fast na ala hele 00:26:bb:79:23:20 -74 149,+1 Y US WPA(PSK/TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP)
mac:bin mike$ airport --getinfo
op mode: station
802.11 auth: open
link auth: wpa2-psk
SSID: fast na ala hele
mac:bin mike$ ls -l /usr/local/bin/airport
lrwxr-xr-x 1 root wheel 89 Sep 13 11:40 /usr/local/bin/airport -> /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport