The Silmarillion, as a work, could be seen as an exploration of Theology. From the first sentence, stating the existence of God, on through the more and more complicated genealogies and factions, the idea runs of the diversity and movement of God's creation. Tolkien did not write in allegory, but he did eventually have to explore the philosophical underpinnings of his mythology. Being a man with a subtle mind, his exploration went quite deep.
I would not say that this is the major theme of the Silmarillion, because the book, published posthumously, was never tied together thematically the way it might have been. The problem of the editing and canonicity of the Silmarillion, done after Tolkien's death by his son Christopher, with half a century of manuscripts, means that it is not possible to establish exactly what Tolkien's thinking was. However, I do believe that The Silmarillion, although not totally what Tolkien would have intended at all points, does reflect his philosophical and theological viewpoints.
An additional caution in interpreting the Silmarillion is that Tolkien knowingly colors his writings with the viewpoints of the supposed authors of the stories- which means that an anthropomorphic understanding of God (as when he lifts his hand, or smiles) is not Tolkien's understanding, but rather the understanding of the Elvish scribes that were writing down his tales. I believe this is more of an issue in details in things like the above mentioned anthropomorphisms, and in the metaphor of the music, rather than in the overall understanding of God.
So, with these caveats out of the way, we should launch into an investigation of what The Silmarillion says about the problem of Theodicy: the fact that an all good, all powerful God can allow evil to exist. The Silmarillion begins with God, and is a great tragedy, with many of the most noble characters being betrayed and killed throughout. God and evil are easy to find in this book. And how did this happen?
The first problem, the first beginning, begins in the first sentence, after the semi-colon. Eru, or God, creates the Ainur, angelic beings. The Ainur are the offspring of his thought, but are independent, having The Flame Imperishable. God instructs them in music, and they all begin to sing, first by themselves, then in small groups, and later together. God allows them to improvise within the music, which is a beautiful, complicated metaphor. It is also a bit of a departure from the standard creation story: God is not the creator of the world's form, but rather a conductor of sorts. This could be seen as a beautiful, complicated metaphor, or it could be seen as Tolkien giving himself some wiggle room in explaining where evil comes from.
And that wiggle room is needed, because soon enough, one of the Ainur, indeed the mightiest, Melkor takes a hand in the music, making his own disruptive music and corrupting those around him into singing and playing it. From here, the music becomes discordant and angry, until finally God weaves a new theme, capturing Melkor's music into his own theme. He then speaks to Melkor, saying "no theme may be played that hath not its uttermost souce in me, nor can any alter the music in my despite".
All of this happens in the first four pages, and over the next 374 pages of the book, we see the strife and hidden beauty of the music repeated as the princes of Elves and Men are systematically killed, tortured, ruined, and betrayed. It is perhaps that Tolkien is using the music as a metaphor for humanity and its fate, or perhaps that humanity and its fate are a metaphor for the music. The entire Silmarillion, and indeed the rest of Tolkien's work, are a restating of those first four pages of creation.
What are we to make of this? It is true that God only authors the music, and gives it to the Angels to perform. And yet, the angels are the result of his thought, meaning
that Melkor, and the other rebellious angels, still have to have their natures explained. Not only that, but the music itself has its "uttermost source" in God. I think that in some ways, this is where the metaphor of the music makes us think more: the music itself has its source in God, but the individual notes within the music can still be the result of evil. Even though they lead to good, they are still in themselves evil. There is a quote later in the work, where Manwe and Mandos are discussing the Flight of the Noldor, and Manwe says that "evil yet be good to have been", to which Mandos replies: "And yet remain evil".
It is a bit of a concept to grapple with, but theodicy tends to lead to hard concepts.
How can the question be answered? There are several answers that are often provided to the question of theodicy, and all of them could be seen through the Silmarillion.
- Deism. A term for the belief that God, once he put his creation in order according to natural laws, withdrew to let it run along its own lines. In the Silmarillion, God does leave the governing of Arda to the angels most of the time, but he does not totally withdraw.
- Free Will. This is the belief that God gives people (and angels) Free Will, and will not suspend that gift, and will not undo the results of people's own action, or else free will would be an empty gift. This could be seen as the case in The Silmarillion (although it seems to be suggested that only men, and not elves, and perhaps not the Ainur have free will). It still begs the question of where the predisposition to evil comes from.
- Pantheism. The belief that God is in everything, and indeed is everything. God is part of his creation, and every part of creation reflects God. This view could also be seen explicitly in the Silmarillion, since all the music, and therefore creation, has its source in God, and also implicitly, since the Silmarillion seems to be the story of the Light of God, seen in smaller and smaller pieces. However, creation is seen as different than the Creator, and evil is viewed as "hateful" to God.
- Gnosticism. Gnosticism is a complicated belief system, but here I am referring to the idea that a false God, or demiurge rules over the world, and that he seeks to eclipse the light of the true God. The Silmarillion could be interpreted this way, since Melkor does indeed try to rule over the world and eclipse the true God. However, God is not a passive principle in the Silmarillion, and he does not allow the demiurge figure to rule unchallenged. Also, gnosticism itself begs the question of how a perfect God allows a demiurge to rise
- God is bound by rational laws. Spinoza propounded a rational God, of a pantheistic nature, that created the world according to laws of reason, and inner necessity. The Silmarillion is not very rationalist, but it could be seen that the God of the Silmarillion gives light, and freedom, out of a sort of inner necessity as much out of will. The subject of God is not treated in measured enough terms to determine whether or not this is true.
I have, in writing these, given explanations internal to the story for why they could not be so. It should also be noted that most of these explanations would not be something an orthodox Roman Catholic like Tolkien would endorse. All of them have a shade of truth, however.
After reading this essay, I urge the reader to go and read those first few pages of the Silmarillion a few times, and then to read the rest of the work, and then The Lord of the Rings again. It will probably not give a solid answer, but it will provoke some very valuable thinking.