The satellites don't 'know' where they are. They're basically just very, very accurate clocks hooked up to transmitters. A network of ground stations -- which do know where they, the ground stations, are -- monitors the signals and from the relative timings/dopplers work out where the satellites are. The ground stations then upload that information back to the satellites, and this is transmitted to GPS receivers along with the timing information. The satellites drift around in space quite a lot; the ground stations stay put (well they don't, but their movements due to tectonics, etc, are known compared to the space segment drifting around up there).
The basic references in the GPS system are the positions of the ground stations and the clocks on the satellites. From those, the rest of the system can find out where and when it is.
R