In order to be a successful theodicy, the purposes stated must be wholly consistent with the notion that God is all-loving, if at the same time also all-knowing and all-powerful. So what is called for is an explanation of the purposes that a loving God with such power and knowledge might have in permitting evil to exist.
The word is taken from the title of a work that supplied one theodicy, namely that this is [The Best of All Possible Worlds]?: the Theodicee? by Gottfried Leibniz.
See also the problem of evil.