A GPS receiver determines your position by finding your distance from a set of orbiting satellites.
Trilateration. Distance from three points puts you at one of two positions – only one near the earth’s surface. Like DME-DME but passive.
The GPS signals are encoded with their transmission time. The time of flight multiplied by the speed of light (300m/ms) gives the distance.
The GPS signals are also encoded with ephemeris information describing the satellite’s precise orbit. The GPS receiver uses this to figure where the satellite was at the time of transmission.