How random number generation works
Modern browsers provide cryptographically strong pseudorandom number generators through the Web Crypto API. These produce sequences that are statistically indistinguishable from true randomness for practical purposes, making them suitable for games and lotteries.
The generator maps the random output to your chosen range with uniform probability, meaning every number in the range has an equal chance of being selected on each draw.