Most speedos in the dash for modern electronic based cars, have a sensor in the output shaft of the transmission. It is a simple reluctor wheel and Hall effect sensor, or a gear driven motor which can then produce a signal for the PCM to interpret. Cars can also use the same method off of the anti-lock wheel sensor to get a "speed" indication. The more ticks from the sensor, the faster the speedo registers. In this method, the signal is sent to the PCM, which interprets the speed and sends a signal to the speedo. Inside the speedo, there is a motor which spins the needle over to the correct position to indicate the speed.
Before electronic gizmos were all the rage, a long piece of spring wire was attached between a gear on the output shaft of the transmission and ran all the way up to the speedometer. This spun a pair of magnets which were close enough at a calibrated distance to move the needle in the speedo. The faster you went, the farther the needle swung over due to the magnet attracting faster and faster.
As for which is more accurate, the speedo or satnav, the elusive it depends answer comes into play. Ultimately the satnav has the greater ability to be more accurate, but it depends on the number of satellites it is receiving from. The more satellites, the better the accuracy. (NOTE: I'm not finding what the accuracy is based on this, but know triangulation works better the more triangles the receiver can make.) I believe that a lot of satnavs will give you the accuracy of their reading if you look into the side menus. The app I use on my Android device (Android-Speedometer) does. Accuracy is also going to be based on which system the satnav system you are using is receiving from. The US launched GPS system is available throughout most of the world (notable exceptions are far Northern and Southern latitudes). It is supposedly good down to 9 meters in the civilian realm, with military usage being better.
A couple of things regarding the accuracy of an automobile have to do with whether the size of the tires are the size which the manufacturer put on the car in the first place. If the tires are smaller in diameter, the reading on the speedometer is going to be higher than it should; larger diameter = lower reading. This is of course affecting the accuracy.
Something else I've often wondered is whether manufacturers actually calibrate their speedos correctly. Of all the speedos I've tested utilizing the roadside radar signs which tell you your speed, almost all vehicles have tested slow for what the speedo is telling me. For instance ... I used to own an '04 VW Jetta 1.8T. I noticed the RADAR signs would read out at 22 or 23 mph while my speedo was reading 25mph. You say, 2mph, that's not a big deal, right? Consider this ... If off by 2mph @ 25, extrapolate that out to 50mph and 75mph. You'd have a difference of 4mph and 6mph, respectively. At 100mph you'd actually only be going 92mph. Let's apply this against your odometer reading. If the car thinks it's going 50mph and only doing 46mph, then your odometer would register 50 miles, when you've only gone 46. Extrapolate that out to 50,000 miles, at which point you've run out of warranty ... yet the vehicle has only traveled 46k. Lets the vehicle manufacturer off the hook early. What about a lease vehicle? This would mean you would run out of miles sooner than you should have, and the lease company can charge you for miles which you've never driven. This could be a big issue. If your vehicle was registering slow in comparison to the satnav, this might be what you're seeing.
For some anecdotal evidence, I ran a TomTom satnav while driving a Camaro which I had put back on the road. The TomTom has a built-in display showing how fast you are travelling. I wanted to know how accurate the Camaro's speedo was so checked it against it. I was quite surprised to find out my Camaro was always within +/- 1mph.
Ultimately I'd give almost always give credit to the satnav's speed rendering over the car's speedo due to the above reasons.