Actually, that's a tough one! In the old days, astronomers at the Royal Observatory in Greenwich estimated the time of day based on the position of the sun. The "mean" (Latin "medianus") refers to the average of their observations. Note that the rotation of the Earth is a little bit irregular... nowadays, we use atomic clocks.