Sauron, Gandalf, the Balrog, and Saruman all belong to the same kind of spirit: The Maiar. These spirits were around since before the universe itself.