There are many incredible ideas underlying GPS, linear algebra, spread spectrum technology and many more. It is not particularly well known that GPS depends upon both special and general relativistic corrections in order to function with an accuracy that is useful for navigation at all (more about this later).
The basic mechanism of GPS operation is simple. Each satellite orbiting the earth possesses an extremely accurate atomic clock and in addition to almanac data, transmits a time signal based the atomic clock time on the satellite. These signals are received by the GPS receiver and a transit time computed based upon the difference between the receiver clock time and the satellite clock time. For each satellite's signal, a spherical shell represents the range of possible distances to the receiver, which is determined by multiplying the transit time by the speed of light. The intersection of three such spheres should represent the receiver position.
People often ask why it takes many GPS units so long to lock on to the satellites. A better question is why the GPS receiver must be in contact with 4 satellites and not 3 as suggested above. After all, there are 3 unknown coordinates and thus the dimension of the linear space should require only 3 equations. The answer to this question is economic in nature. While the satellites each include one or more extremely accurate and expensive atomic clocks, placing such an accurate clock in the GPS receiver would be prohibitive from a cost perspective.
Instead, a clock correction is computed for the GPS receiver and this is why 4 satellites are required. So in fact, the GPS receiver solves a 4-D system of linear equations for the three spatial coordinates and the time component.