The random function is a pseudo random number generator, a complex mathematical function returning randomly spread numbers over a range. Because every new number is calculated based on the previous it has to be initialized at some point (called seeding). For the seeding it's best to use some truly random value as it is the noise on a not connected analog input.