So those unique keys every user can get for free are created with a base random number given by that device. That device can be an Android or an iOS phone, or a PC running Windows, or Linux, or a Mac.
But the interesting rabbit hole is: how can a computer device come up with truly random numbers, if it’s programmed and therefore (with some luck, looking at you, Windows) ultra predictable?
Well, there’s no easy response for that.
Sadly, in most cases it’s a bit of a black box. We cannot really tell what’s going on in there. There are specific hardware randomness generators which are expensive and therefore not common, that take some tiny physical phenomena, like the noise-like data from electrons as the seed to start generating numbers from. Basically the universe is filled with physical stuff we don’t know how to predict, and that makes a great start for a random number.
For all purposes we’ll assume our pseudo random number generators are good enough, say to ourselves “Everything is fine” and continue with our journey.