How Random Number Generators Work
A random number generator (RNG) picks a number with no pattern you could predict. Some are only pseudo-random: they follow a formula and are predictable if you know the starting value. Randomly uses your browser's cryptographic random source instead, which draws on unpredictable system sources.
Why fairness matters
Taking a big random value and using the remainder after dividing by the range size slightly favors some numbers. Randomly discards those values and draws again, so every number in your range is equally likely.
Good to know
Random does not mean evenly spread. The same number twice in a row is normal, and a number that has not appeared lately is not "due". Randomly is for everyday use, not lotteries, gambling or cryptographic keys.