Also, if you know your elevation you need only two satellite measurements because you are on the surface of a sphere centered at the center of the earth. The upper code as it is being received from the satellite. The lower code is the same code being generated by the receiver. Getting perfect timing. If the satellite clock and receiver clock were out of sync.
Satellites have four atomic clocks on board.
Receivers have cheap clocks. Computers in the receiver shave nanoseconds equally off all the apparent readings until a unique solution is attained. In 3-dimensional location exercises, three satellites are needed for location and elevation, and an additional one for clock synchronization. They are above any atmospheric drag effect. They are constantly monitored by DoD. Satellites transmit a data message about their exact location and their system's health.