GPS is really a set of very precise clocks in orbit. Your phone, your truck's navigation and a lot of the world's timekeeping work because those clocks are set slightly wrong on purpose, to allow for Einstein's relativity.
These clocks run from your own device's clock, so they are only as good as it is. They show the difference between the three, not official time.
GPS time started at midnight on January 6, 1980 and never adds leap seconds. UTC has added 18 leap seconds since then to stay in step with the Earth's slightly irregular spin, the last one at the end of 2016. That is why GPS time is now exactly 18 seconds ahead. Receivers are told the difference and correct for it, so your phone still shows the right time.
Each GPS satellite keeps broadcasting, in effect, "I am here, and this is the time." Radio waves travel at the speed of light, about 300,000 km per second. Your receiver notes how late each signal arrives, and that delay tells it how far away each satellite is. Where the distances agree, that is where you are. It needs at least four satellites: three for your position and one more to work out the error in its own, much cheaper clock.
The close-up is 4 km across. The green dot is where you really are; the red dot is where the receiver works out you are.
One millionth of a second is about 300 metres. That is how far a radio signal travels in one microsecond. A satellite clock that is off by just one microsecond puts its distance wrong by 300 m, and your position can be off by hundreds of metres or more. GPS satellites carry atomic clocks (rubidium and caesium) for exactly this reason.
Einstein worked out two effects that change how fast a clock ticks. Both apply to a GPS satellite, and they pull in opposite directions.
The fix is built in before launch. GPS clocks run from a reference frequency of 10.23 MHz. On the ground, each satellite's clock is deliberately tuned slightly slow, to 10.229 999 995 43 MHz. Once it is in orbit, relativity speeds it up by just the right amount and it ticks at exactly 10.23 MHz as seen from Earth.
Without that correction, the satellite clocks would race ahead of the ground by about 38 microseconds every day, which is more than 11 km of range at the speed of light. A receiver can cancel an error that is exactly the same on every satellite, but the clocks never drift exactly alike, and GPS's other big job, giving the whole world precise time, would be ruined within minutes.
Even with the factory correction, no two satellite clocks are perfect, and no two orbits are exactly round. So GPS keeps tuning, every day:
Monitoring stations around the world track every satellite. The control centre in Colorado works out how far each satellite's clock is off and where its orbit really is.
Those numbers are uploaded to each satellite, which broadcasts its own clock correction along with its position. Each satellite tells your receiver, in effect, "my clock is off by this much."
Your receiver applies each satellite's correction, plus a tiny extra one because the orbits are slightly oval: a satellite speeds up and dips lower at one end of its orbit, which changes its clock by tens of nanoseconds.
Ordinary receivers know where they are to within a few metres and know the time to within a small fraction of a microsecond, which makes GPS one of the best clocks most people own.