The bike computer itself can measure speed by the build-in GPS after satellite signal is located.
When equipped with a speed sensor, the speed is from speed sensor,which is the same as the speed from GPS.
The only difference is that the speed from GPS may delay, become lower or lose if riding in extremely surroundings like indoors or in the tunnel.
But, the speed sensors won’t be affected by the external environment.
It’s better to equip a speed sensor if riding at the places where GPS signal is not available, like in tunnel, mountainous area or indoors, or or near buildings.
Speed sensors use the size of your bike's wheel and the number of rotations it makes during a cycling activity to determine your distance.The speed at which your wheel rotates will determine speed.
To measure accurate speed, you need to set the correct wheel size.
See articles to set the wheel size