While there is certainly something people call a random number generator (RNG here), it does not actually generate random numbers. Computers are not capable of this.
Before you read on, note: this is nerdy information (which seems welcome here), it will not in any way affect your gameplay, and there is no realistic way to use this information to cheat the odds.
People are capable of thinking of a random number from x to y, but computers have no capability to generate something from nothing. There always needs to be input of some kind. Programmers can effectively simulate the picking of a random number, but it always needs input, which then bases the number on something, making it not really totally random.
The most used method for programmers is to use the system time clock, and specifically the milliseconds. If a number from 1 to 25 is needed, the programmer will take the total milliseconds on the clock, divide it by 25, then take the remainder as the generated number. You can see how this would be a problem if they used something large like full seconds, but milliseconds and smaller units go by so fast that they are effectively random if you stop them at any given point. To randomize it even more, a seed number is often used (added to or multiplied by the clock number). When programming command line mainframe stuff, the seed can be input by the user. With a program such as Empires, it could be any unpredictable thing (like the 4th letter of your username multiplied by the last number of your account). The stranger the seed, the more closely approaching random the resulting number is.
In the end, these numbers are effectively random, but not actually random since they are based on something with a repeating pattern (the clock). It would take a similarly powered computer to “hack the system” so to speak, which isn’t realistic, so no one really worries about that.
Anyway…this isn’t actually useful information, just interesting to computer and math nerds. Also, I’m bored at work and my boss can see when I’m playing on my phone, so here we are.