https://lotteryboost.com/the-science-of-random-number-generators-in-lotteries/
"Most digital lottery systems utilize PRNGs. These are software algorithms that start with a “seed” number and apply a complex mathematical formula to produce a sequence of numbers that appear random [1]. While highly efficient, PRNGs are technically deterministic; if you knew the exact seed and the algorithm, you could theoretically predict the outcome.
To prevent this, modern lotteries use high-entropy seeds—such as the exact millisecond of a system clock or thermal noise—to ensure the starting point is impossible to guess. As we explored in The Science of Randomness in Lottery and Gambling, the goal isn’t just to be random, but to be unpredictable to the human observer."
Years ago, I was reading an article on how slot machines generate random numbers to determine the reel settings for the next spin. Rather than generate just one random number at a time, every time the player hits "spin" (making reverse engineering possible), what they do is have the machine generate random numbers constantly. Then, when the player hits spin, the machine takes the next random number generated (a thousandth of a second later) and uses that one.
The above article describes essentially the same thing, that the RNG uses the current system time, down to the millisecond, as a seed value. This makes it impossible to predict what the RNG will generate for the next random number, because the formula (even if known) uses the exact time the button is pressed as its seed value. No one knows what the exact time the button will be pressed until it is pressed, and of course by then it's far too late to buy a ticket.
For both slot machines and lotteries, there have to be safeguards around the RNG to prevent tampering (like with Eddie Tipton). Slot machines require two different keys to get to the CPU, the keys have to be checked out by a known employee, and tampering with the CPU will cause it to "brick" itself and stop working. A well-protected RNG lottery is set up in a similar fashion, with restricted access and self-bricking failsafe measures.