We celebrate Pesach to thank G-d for taking the Israelites out of Egyptian slavery. But it was G-d who put them there in the first place. If He would not have made us slaves then there would be no need for all the miracles at all. Same with every miracle - G-d makes the problems, then gives us a solution to the problem that He caused in the first place, and then we thank Him. Does this make sense?
One of the most powerful ramifications of monotheism is that both good and bad ultimately come from the one source - G-d. Anything that happens to us, whether it brings us pleasure or pain, whether it makes life easier or harder, is a part of the divine plan. There are no two powers wrestling over control of the universe, there is but one power, from Whom everything stems.
This means that in truth there is not good and evil, but rather two types of good - revealed good and hidden good. Even the bad times are ultimately for the good. Any challenge I go through, any pain I experience, must have some positive purpose, because all comes from the one G-d, Who is good and purposeful.
To find meaning while in the midst of pain is hard, sometimes impossible. But afterwards, once the pain subsides and I get through it, I can look back and try to see what I have learnt from the negative experience. Sometimes, in a moment of clarity, I may even be able to say that, as painful as it was, I needed to go through it.
This is why on Pesach night we commemorate the Exodus by eating Matzah, and we also commemorate the slavery by eating Maror, bitter herbs. To truly appreciate freedom, you need first to experience its absence. The bitterness of slavery is what led to the sweetness of freedom.
But strangely, we eat the Matzah before the Maror. This seems backwards -- the slavery came before the freedom, so why don't we eat the Maror first? Because only after experiencing freedom can we look back on our slavery and realise the good hidden behind the pain. We acknowledge that we are who we are today not only because of the freedom we gained, but also because of the pain we experienced. The Jewish national identity was shaped by the slavery as much as by the liberation from it. Our resilience, survival instinct, and ability to adapt to any environment was born out of our painful beginnings in Egypt. As free people, we can look back and appreciate what slavery did for us. After we eat Matzah, we can go back to the Maror and understand its purpose.
Why must we feel pain in order to grow? Why couldn't G-d arrange things differently, that we should be able to learn lessons painlessly? These questions are unanswerable for now. Until Moshiach comes and all pain becomes something of the past, the mystery remains a mystery. But it remains the fact - we only truly develop as people by facing adversity.
Our world has seen enough pain. Just as the pain of Egyptian slavery ended on Pesach, may all pain end with the arrival of the era of ultimate freedom.