ol.control.Scale displays the scale of the map in a control.
NB: Some projections and specialy the default Mercator projection preserve angles but not the distance. This means that the scale is not the same on the whole map :(
The control display the projection on the center on the map and it may change when moving on the earth. Just move from equator to the pole and see the ScaleLine length growing.
NB: The control needs to know the screen PPI (or DPI) to calculate the right scale. Be aware the PPI depends on the device (screen, printer) your are using and may be quite different form one to another depending on the resolution of the device.
The default value is 96.