Understanding GPS
The US GPS system is a collection of 24 space vehicles placed in an approximately 12 hour orbit at 55 degrees from the equitorial plane around the earth. By knowing exactly where these satalites are with regard to the earth, comunication with a GPS device can be trilaterated to calculate it's postition as well. GPS delivers to us 4 peices of data. Longitude, Latitude, Altitude, and Time.
Earth is a rock
The Earth is not spherical. Neither is it an ellipsoid, although we use an ellipsoid to approximated it. The Earth is actually a geoid, or shaped like a rock.

The System
The standard for this is constantly in a state of flux, but at this moment, the system is defined by the WGS-84 standard.
[WGS84 Implementation Manual]

Europe has been working on developing their own Galileo GPS system, mainly in the interest on not relying on a US system that can be locked out as a negotiating tactic. Russia uses it's own GLONASS system.
Mathmatics

The earth surface can be approximated as an Oblate Sphereoid or Oblate Ellipsoid. The GPS system uses a definition contained in WGS-84. This model has an equitorial radius of 20925646 feet and a polar radius of 20855487 feet.
F = (x/a)^2 + (y/b)^2 + (z/c)^2 where a = b = 20925646 and c = 20855487.

