Internet geolocalization

How does internet work?