Khartoum earned his great magical power by repeatedly making deals with the Friends. He had already paid off his debt by engaging in merciless conquests of lesser kingdoms in the Seven Deserts before the High Council caught up to him and used lawful magic to seal him away in his own spellbook so as to make sure he never caused trouble again. Other sorcerers such as Jafar and Destane would come after him, but never reach the magnitude of power he wielded by himself.
Many years later, the Friends were able to briefly free him with the unwitting help of Mozenrath and the Philosopher's Stone, just before he ended up getting sealed away again by the combined power of Gene and Eden, this time for good. Afterwards, the High Council made sure to look away the spellbook within the vaults on Mt. Olympus so as to make sure no more agents could get their hands on it.