GPS works by timing: 24 or more US military satellites, each carrying atomic clocks, broadcast their exact position and the precise time; your receiver compares signals from at least four satellites and computes its position by trilateration — distance equals time delay times the speed of light. Accuracy: a few meters, anywhere on earth.
The system, NAVSTAR GPS, was conceived by the US Department of Defense in 1973, launched its first satellite in 1978, and reached full operational capability in 1995. Built to guide missiles and troops, it was opened to civilians after Korean Air Lines Flight 007 was shot down in 1983 — and became the invisible infrastructure of modern life.