>>534336429
that's 100% up to you.
You could use a dificulty variable, a variable that counts how many enemies the player has killed, the number of levels, use enemies that counter act the player current weapon.
You can have a random number, and then have each option have a secondary choice.
Or do stuff like a random number divided into 2 tiers, and then make one being easy and the another spawn a harder enemy a 1/3 of the time.
Your question has a million ways to be solved, and is when coding becomes more an art than a science.