GPS works on the signals transmitted and received by satellite constellation
The Global Positioning System (GPS) is a system of around 30 satellites circling the Earth at an elevation of 20,000 km. The concept is simple. The GPS receiver gets a signal from each GPS satellite. The satellites transmit the exact time the signals are sent. By subtracting the time the signal was transmitted from the time it was received, the GPS can tell how far it is from each satellite.