GPS needs a bare minimum of 3 sats to compute location.
Most units use a minimum of 4 to get a fix. Add more sats into the into the data stream and you can get altitude. The GPS system will calculate an extremely accurate clock.
Take this clock, and multiple "fixes" over time and you can calculate speed. Most GPS receivers are updating position about 60 times a second. Most recreational GPS receivers take the 60 calculations and average them out over 1 or 2 seconds. With marine units that average is usually adjustable as rapid speed changes are useless on a boat.
Unless your GPS is defective, I would take it's speed reading over any vehicle based speedometer.
As for ups and down - the speed is still be calculated, very accurately. I use NorthStar GPS units on the boat, very precise units. As the boat goes up and down the waves you can see the speed change, slowing as you climb and increasing as yo start surfing down the wave.
Some time ago Power and Motoryacht magazine took a then new on the market Garmin 276, a $20000 survey GPS unit and police RADAR units and did comprehensive speed comparisons.
Both the Garmin and the survey GPS were found to be both right on the money and far more accurate then the RADAR.
As to the max speed error, this is the answer I received some time ago, make sense to me. If you think about how accurate the fix and calculations are, even a split second of sat viewing issue could throw off the "calculated" max speed. It happens so fast the display doesn't register a change, but the history records it.
While the max-speed indicator is a reliable indication of the minimum "max speed" you have achieved since last reset it is unreliable when it comes to displaying the real maximum speed. This means you can use it to prove you have gone no faster than what it displays but you can't use it to establish a new speed record. As the satellites drift in and out of sight or you encounter some multipath interference your unit will compute a slightly different solution based on the available satellites and this difference can result in an instantaneous change in position. This change can confuse the max speed indicator into thinking you traveled rapidly to the new location. Luckily these are usually very easy to spot.
BTW, the highest max speed I have seen on my Garmin has been 375 mph.