Some interesting reading that might help you understand

https://en.wikipedia.org/wiki/Random_number_generation