Traditionally determining a user's location involved mapping their public IP address to an approximate geographic area. Unfortunately, this method is quite inaccurate - especially in situations where networks employ NAT allowing multiple users to have the same public IP.
HTML5 brought about an interesting, new geolocation API. Although the spec for this API doesn't mandate a specific implementation, Chrome implements the API by attempting to find the most accurate location possible by simultaneously consulting multiple location providers. These providers include GPS, cell-tower-based location, wifi-based location, and finally the traditional IP-based location. In most cases, this allows us to get location with an accuracy of less than 100m.