Wizards are definitely in a different group than elves or men. They are a class of being called maiar (singular maia). Sauron and the balrogs are also maiar. They’re sort of junior gods (to oversimplify) in Tolkien’s universe. The great gods are the Valar (singular vala), the demiurgic beings of Middle Earth. The vala Aulë was a smith who crafted, among other things, the mountains and other lands of Middle Earth. Sauron and Saruman were both followers of Aulë. And they were both good at making things (Sauron especially). If I remember correctly, Sauron raised the mountains around Mordor.
The most powerful vala was Melkor, later known as Morgoth, who fell into evil. He was defeated and removed from the world at the end of the First Age. The greatest of the maiar whom he seduced into his service was Sauron. Some of the maiar who followed him took the form of monstrous creatures who wielded whips of fire. They were the balrogs. In Moria Legolas recognized the ancient creature as “A balrog of Morgoth.”