A theodicy is a theory about why an omnipotent God allows evil to exist in the world. In other words, a theodicy contains speculations about God's actual purposes in allowing evil to exist in the world. A theodicy is required to explain how an omnibenevolent, omnipotent and omniscient God can have allowed terrible evil to occur, as these three attributes appear to be in opposition to each other. A theodicy is not required if God is not held to be either omnipotent, or omniscient, or omnibenevolent.
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. Many proposed theodicies exist; none is accepted by every faith; none, in fact, is accepted by all members of any one given faith.
Theodicy is unnecessary if one rejects the view that God is omnipotent. In Unitarian Universalism, in much of Conservative and Reform Judaism, and in some liberal wings of Protestant Christianity, God is said to act in the world through persuasion, and not by coercion. God makes Himself manifest in the world through inspiration and the creation of possibility, and not by miracles or violations of the laws of nature. In short, in order to guarantee that humanity has free will, God is not omnipotent. The most popular works espousing this point are from Harold Kushner (in Judaism). This is the view that also was developed independently by Albert North Whitehead and Charles Hartshorne, in the theological system known as process theology.
See also the problem of evil.