The simple answer is, yes, everything happens for a reason, but keep in mind that things can happen due to a variety of reasons. First of all, God is sovereign. He has the power to do all things: "Whatever the LORD pleases, he does, in heaven and on earth, in the seas and all deeps" (Psalm 135:6). However, God gives us free will to make our own decisions. So, everything happens for a reason, but that does not mean that God is always the one directly making it happen. There are several different reasons we should consider: sowing and reaping, original sin, and divine providence.
Does everything happen for a reason?
The principle of sowing and reaping is all about investment. Everything we do functions as an investment into our future. Some things happen because of the seeds that have been sown to bring them about. Seeds are sown, and later, the rewards are reaped. Galatians 6:7–10 says, "Do not be deceived: God is not mocked, for whatever one sows, that will he also reap. For the one who sows to his own flesh will from the flesh reap corruption, but the one who sows to the Spirit will from the Spirit reap eternal life. And let us not grow weary of doing good, for in due season we will reap, if we do not give up. So then, as we have opportunity, let us do good to everyone, and especially to those who are of the household of faith." Proverbs 22:8 says, in part, "Whoever sows injustice will reap calamity." Whether people reap the due rewards or consequences of their actions in this life or the next, the Bible says they will receive what is due them (Hebrews 9:27).
God created a perfect world, but after the fall of mankind the world became cursed (Genesis 3). Things like natural disasters, illness, and untimely death are hard to reconcile with a reason. Sometimes the reason behind happenings in our lives is merely the fact that we live in a fallen earth (Romans 8:19–22). "But according to his promise we are waiting for new heavens and a new earth in which righteousness dwells" (2 Peter 3:13). Because righteousness will reign in the new earth to come, there will be no room for these disasters. We can have hope that even if things don't turn out well on this earth, there is a perfect world yet to come.
Keep in mind that if you are a child of God, sometimes He brings things into our lives as a form of discipline or testing. See Hebrews 12:5–13 for more about this. Romans 5:1–5 and James 1:2–4 talk about enduring trials and the good things they can produce in us. Jesus told His disciples that there would be hardship in the world (John 16:33.; We also know that the world will many times hate the message of Christ and, as a result, His followers (John 17:14; 2 Timothy 3:12). We also know that we have an enemy—Satan—and that spiritual warfare is real (1 Peter 5:8; Ephesians 6:10–18). Sometimes things happen because of the sinfulness of humankind or because of spiritual realities.
Above these other reasons, we can trust that God's divine providence is always at work. He works even in the recognizable reasons that things happen. We are often more aware of divine providence as the reason for some things that may otherwise seem unexplainable. God, being omnipotent, is able to work situations out for us behind the scenes, so not everything is merely a coincidence. Sometimes, circumstances that appear to have a cause and effect, are more about God's deeper purpose. For example, John 9:1–3 records, "As [Jesus] passed by, he saw a man blind from birth. And his disciples asked him, 'Rabbi, who sinned, this man or his parents, that he was born blind?' Jesus answered, 'It was not that this man sinned, or his parents, but that the works of God might be displayed in him.'" Jesus had a deeper purpose in this man's blindness. He healed the blind man and it served as a demonstration of His power and goodness.
The story of Joseph serves as another demonstration of God's divine providence. After being sold into slavery by his brothers, rising to power in Potiphar's house, and then being falsely accused of raping Potiphar's wife, Joseph was thrown in prison. He interpreted two other prisoners' dreams, but it wasn't until over two years later that he had the opportunity to interpret Pharaoh's dream. Joseph was released from prison and promoted to second in command of all of Egypt. Only divine providence could have worked out the details to promote Joseph from prison to the second most powerful man in Egypt. (See Genesis 37—41 for the story of Joseph).
In conclusion, there are several reasons why things happen. The good news is that even when bad things happen, God can work His purposes out of every situation. What the enemy meant for evil, God can turn into good: "And we know that all things work together for good to those who love God, to those who are the called according to His purpose" (Romans 8:28, NKJV). God's methods can change, but His purposes will ultimately prevail.
Is God sovereign or do we have free will?
What is God's will?
What is a biblical perspective on suffering? What does the Bible say about suffering?
How can I come to really know God?
Christian worldview - What is it?
Truth about Worldview and Apologetics