Asmodeus convinced the gods to sign a contract called the Pact Primeval. This contract allowed Asmodeus and his fellow devils to take up residence in the abandoned realm of Baator, to punish the souls of wicked mortals, and to extract magical energy from the souls under their care in order to fuel their powers. Otherwise, Asmodeus reasoned, they would have to be granted the powers of godhood in order to do their job, which the current gods would surely find unacceptable.