Geolocation works through methods like the geolocation API used by modern browsers. It uses sources such as GPS, Wi-Fi networks, cell IDs, and IP addresses to determine a user’s location.