You are right...radar is more accurate than a gps. GPS speeds can vary due to a couple of factors. First,, the accuracy of typical over-the-counter gps units is only about 15-25 feet. That relative innacuray in pinpointing the position can lead to error s in the speed calculation...but they usually cancel themselves out if you are travelling at highway speeds in open country with several satellites available. Second, a gps measures distances that are assumed to be horizontal. Steep hills cause you to travel farther than the gps thinks you do, so you can be moving faster than it calculates. Again, this effect is limited to the mountains and steep hills, and is relatively minor. By all means, check your speedo against radar or time it between mileposts if you can, but most gps units are quite accurate, and provide an excellant comparison.
BTW the gps calculates speed based on how far it senses you have moved in a certain time.