Finding Yourself on the Map
GPS is something close to a small miracle that we now take for granted. Your phone can show a little dot on a map marking exactly where you are standing, anywhere in the world. It guides drivers, hikers, and deliveries every day. But your phone is not magic. So how does a device in your hand figure out its precise position on the entire planet? The answer is in the sky.
Satellites in the Sky
GPS, which stands for Global Positioning System, depends on a set of satellites orbiting high above the Earth. These satellites are spread out so that, from any point on the ground, several of them are overhead at once. Each satellite constantly broadcasts a radio signal toward Earth. This signal carries two crucial pieces of information: exactly where that satellite is, and the precise time the signal was sent.
Measuring Distance With Time
Your device, such as a phone, listens for these satellite signals. Radio signals travel at a known, constant speed, the speed of light. By comparing the time a signal was sent with the time it arrives, your device can work out how long the signal traveled. Multiplying that travel time by the signal's speed gives the distance between your device and that satellite. So from each satellite signal, your device learns one thing: how far away that satellite is.
Combining the Distances
Knowing your distance from a single satellite is not enough; you could be anywhere on a huge sphere around it. But your device measures the distance to several satellites at the same time. Each distance narrows down the possibilities, and where all of them agree, there is only one point that fits. That point is your location. This method of fixing a position by combining several known distances is called trilateration, and it is how GPS pinpoints you on the map.
Source
This article was written using information from Wikipedia.