There are 24 satellites around the world each of them transmit:
- The current time on their clock
- Their location relative to earth
The distance between us and a satellite must be equal to the difference in time it took to receive the data sent by the satellite multiplied by speed of light(c). d=(t2-t1)*c.
Remember how in math the distance between two points is d = sqrt((x1-x2)^2+(y1-y2)^2)). The same equation is used but now we have x,y,z instead of just x,y.
Looks like we have 3 unknowns which is the position of the receiver (x,y,z). However there is a bias in the time due to relativity and computational delays. Since the value of c is so big, it can create large errors, we treat this bias as an unknown as well.
So we have unknowns we need four equations to solve the problem. Therefore we use the distance equation with 4 different satellites. We get four non-linear equations, which is a minimum to lock your position, but if there are more satellites available more equations can be used to give better results.
These equations are solved iteratively since they are non-linear. You cannot used the elimination and back-substitution method(which is taught in school math classes). The processor repeatedly solves the set of equations using an initial guess and each time using results of the previous iteration as the guess to get better results until it reaches a point where another iteration gives a very small change.