Basically it receives a time signal and location of a number of satellites. With this information a little trig can calculate position.
Do this 2 or 3 times calculate distance moved over a period of time and you have enough information for track and ground speed.
Of course your magic GPS does this in split seconds much quicker than I can type.
How Does GPS Work?