remove errors in readings

I'm still confused. The best way to get the best value from a sensor is using the average.
Using the highest value that a sensor gives will create extra noise.
How can the standard deviation create a better value then the average ?