GPS is short for Global Positioning System.
GPS consists of Satellites in space and a GPS receiver.
A GPS receiver's job is to:
Locate three or more of these
Figure out the distance to each
Then to use this information to
deduce its own location.
In order to calculate the position, the GPS receiver has to know:
The location of at least
three satellites above you
The distance between you and each of those
The GPS receiver figures both of these things out by analysing high-frequency, low-power radio signals from the GPS satellites.
The satellites send out a message using radio signals with the date and time in.
The receiver will then measure the transit time for the message and use that to determine where it is in relation to the satellite.