How the random number generator works
Set the lowest and highest numbers and how many to pick. Both ends are included, so 1 to 10 can give 1 or 10. When picking several numbers you can choose no repeats, so each number appears at most once, and sort the results from low to high. For a single number from a range of up to 100, a wheel spins to reveal it, and the number is chosen before the wheel moves, so the animation never changes the odds.
Every number comes from your browser's secure random number generator, with rejection sampling so that each whole number in the range is exactly equally likely.
Fair random numbers
Computers generate random numbers in binary, so turning them into a range such as 1 to 6 needs care. A simple shortcut, taking the remainder after division, makes some numbers slightly more likely than others. Rejection sampling avoids that bias by throwing away the rare raw values that would make the result uneven and drawing again.
Example: Picking 6 different numbers from 1 to 49, as some lotteries do, can produce 13,983,816 different sets. Any particular set, including 1, 2, 3, 4, 5, 6, is exactly as likely as any other.
Good uses, and when not to use it
Random numbers are handy for games, classroom activities, picking a random page or question, sampling items from a list and choosing who goes first. For official lotteries, prize draws with legal rules or security uses such as passwords, use the method the rules require or a dedicated tool, and keep a record of how the draw was done.