Why do bad things happen? For pedagogical reasons, so that we can experience the power of Allah, catch a glimpse of Hell and fear it, so that we can practice seeking refuge in Him and, when relief comes give thanks to His mercy. Darkness was created so that, like plants, we could yearn and turn to the light.