Normal mechanism

The vast majority of monsters in Nethack originate when the game wants to create an unspecified opponent of adequate difficulty for the player. This is what the frequency field refers to in the individual monster pages. See Monster_frequency for details on what can be created and extinctionism about limits to that.

Occasionally, players will encounter monsters far too difficult/weak or in the wrong dungeon branch. Usually, these opponents have not been created, at least not in their current form, but are the result of a polymorph trap. Monsters can also use potions and wands of polymorph, or be innate shapeshifters. All bets are off what a polymorph might result in.

Certain high-level monsters can cast summon nasties (summon insects for priests). Both result in a characteristic selection of monsters. Demons may also summon each other.

Finally, special rooms and special levels have their appropriate population.