Why do bad things happen? In answering this question, I realize that there are many who have suffered a great deal of unexplainable troubles in this life and who, to this day, cannot figure out why. My attempt to answer this question is in no way intended to minimize the trouble many have endured. I’m just going to look in the Bible to see what it says about this subject. I believe these passages will explain many bad things that happen, but not all.
God allows bad things to happen for numerous reasons. One reason that they happen is so that God can demonstrate His power. A great example of this is found in the Bible in regards to the Egyptian captivity that the Israelites suffered for over four hundred years (Exodus 1-14). In speaking of this, the Apostle Paul said in Romans 9:17, “For the Scripture says to the Pharaoh, "For this very purpose I have raised you up, that I may show My power in you, and that My name may be declared in all the earth." In essence, God allowed Pharaoh and the Egyptians to enslave the Israelites so that His power could be demonstrated in their deliverance. The longer Pharaoh hardened his heart and refused to let the people go, the more opportunity that God had to display His power to not only the Egyptians, but to the Israelites as well.
The bottom line is that we may have to endure something bad NOW (I.e. the Jewish captivity in Egypt), so that God can be allowed to demonstrate His power LATER.
As matter of fact, later when Israel had already been delivered from the Egyptians, they came to the city of Jericho and met a harlot named Rahab who told them, “I know that the LORD hath given you the land, and that your terror is fallen upon us, and that all the inhabitants of the land faint because of you. For we have heard how the LORD dried up the water of the Red sea for you…and what ye did unto the two kings of the Amorites…And as soon as we had heard [these things], our hearts did melt, neither did there remain any more courage in any man, because of you: for the LORD your God, he [is] God in heaven above, and in earth beneath.” Joshua 2:9-11