It is basically an accelerometer. ie it measured how fast the hub is rotating. Then you calibrate the Edge with your wheel size, and it can calculate your speed and distance. Or you can set the Edge to automatically calibrate, using GPS.
Presumably you are not using any sort of speed sensor currently? If not, then the Edge will use GPS for speed/distance. This is usually pretty good, assuming you have a clear view of the sky. But GPS can be inaccurate if you are close to tall buildings, or going through a tunnel etc. Or if you are going around a tight corner, the GPS could cut across. So for a particularly twisty ride (ie offroad), the GPS could record under distance.
Or for any stationary/indoor rides (ie on a turbo trainer), the GPS won't record anything, so you need the sensors if you want speed/distance.
But the speed sensor can also be inaccurate. ie how well is it calibrated. How accurately can you measure your tyre diameter, which could vary depending on your tyre pressure etc.
Personally, I wouldn't bother with a speed sensor, unless you have noticed inaccuracies with the GPS, or if you regularly cycle through tunnels.