That's just one narrow case of the larger question: why are the actions of an "all-powerful and all-knowing" God entirely consistent with God not existing at all?
it is an understandable question.
if there is an all-powerful, all-knowing God, who else, other than the God Himself can answer your question best?
Why doesn't God prevent evil?
I suggest, The first thing to know, is what is the purpose of God for creating this world. Because if we know what is the purpose of God for creating it, then, we can see why it is like this.
why God created this world:
"The world is a
school in which there must be Teachers of the Word of God. The evidence of the ability of these Teachers is efficient education of the graduating classes."
"...things are often known by their opposites. Were it not for darkness, light could not be sensed. Were it not for death, life could not be known. If ignorance did not exist, knowledge would not be a reality.
It is necessary that each should exist in order that the other should have reality. Night and day must be in order that each may be distinguished. Night itself is an indication and evidence of day which follows, and day itself indicates the coming night. Unless night were a reality, there could not be day. Were it not for death, there could be no life. Things are known by their opposites."
www.bahai.org
So, why there is evil? So that goodness becomes a reality and can be known. If there was no evil in this world, we would not know what goodness is. This world is a school, that we learn goodness, and develop good attributes.
We need to understand and practice good attributes, so that, our soul becomes ready to live on, in the Spiritual worlds of God, after we pass.
If you are clever, you should ask, what evidence is there that, God has created Evil, and Goodness. How did God create Evil and Goodness? This is the question