Agree, it seems that it conflicts I will provide you a correct answer very soon. But I quick answer would be like, He has created the harm, but still he is going to proctect the believers from the harm, or the ones, who would want to be protected from harm. To conclude we should not think of God as our self if you know what I mean, He is knowledgable but his knowledgable is not same as ours, he has Got a perfect knowledge
Another one which you could be confuse would be!
Same as
Al-'Adl 29 The Just
Al-Ghaffar 14 The Forgiving
those two as well, if He just (i don't doubt) then How is He going to forgive, is he going to forgive everybody (which would make him unjust).