Mizmor 92
Our Rabbis tell us that Moshe Rabbeinu wrote Megillos for the Jewish People, which they used to read on the Shabbos. Pharaoh tried to stop the Jews from reading those Megillos [scrolls] on Shabbos [Shemos 5:9].
What were those Megillos? What was in them?
Rav Yaakov Kamenetsky suggests the following. The Talmud [Bava Basra 14b] says that Moshe Rabbeinu authored some of the chapters of Tehillim [Psalms]. Those were the scrolls that the Jews read in Egypt. One of the chapters was “A Psalm to the Day of Shabbos" [Tehillim Chapter 92]. However, if you examine that chapter, you will find that Shabbos is not mentioned at all. What is its connection to Shabbos? Rav Yaakov Kamenetsky suggests that the connection is that the Jewish people read that chapter on Shabbos when they were in Egypt.
Why did the Jewish people read that chapter on Shabbos? Tehillim 92 contains the words “when the wicked flourish like the grass, and all the doers of iniquity blossom forth...” Those words introduce the concept that “Bad things happen to the Tzaddik (righteous); Good things happen to the Rasha (wicked)”. This issue understandably weighed heavily on the minds of the Jews in Egypt. “What is happening? We are righteous. The Egyptians are wicked. Why are we the slaves? We don't deserve this."
Moshe Rabbeinu provided this Psalm, which acknowledges the principle of the wicked flourishing. Years later, it might have been possible to begin to appreciate that the experience of Egypt molded us into a special nation. However, while in slavery, without the benefit of time and hindsight, there was no way for them to understand any rationale or redeeming feature of the slavery experience.
Such experiences often must remain simply a matter of faith. We need to maintain that faith, and remember that ultimately, we will understand the good in everything.