Since there's no such thing as random in terms of microcontrollers, the function call random() runs an algorithm that creates a pseudo-random value based on a seed.
Since reading analogRead(0) would be an effectively random value, this effectively, gives you a random seed.