Speedometers on most boats use water pressure from forward motion through water to pressurize air, which is then converted to a speed reading. When working correctly, they are surprisingly (well, to me, anyway) accurate. Problem is, they aren't always working correctly, and give no other indication that they aren't (aside from a reading of, say, 4 mph when on plane with the throttle whacked forward.)
GPS uses satellite signals to read the displacement in a given unit of time to generate a speed reading; will be very accurate assuming you are getting a GPS signal (which should be all the time on the water.)
GPS will only read SOG; speedometer will read speed through water, which will be affected by running up or down currents.