Everyone agrees that torturing and suffering are both fundamentally bad things. When the Jews were in the Galuyot, previous exiles ( before the current exile), they went through many hard times which at first glance seem detrimental to their existence. While it may seem ideal for a nation to remain in charge of it's own land without having to go through the horrible experience of being slaves to another nation, Rav Soloveitchik explained that these exiles were integral to the history of the Jewish people, and may have actually been beneficial. The Jews suffered through two major exiles from which they were redeemed so far: Egypt and Persia. In both instances the totality of their Jewish existence was threatened. If the ruling nations had succeeded, they would have put an end to the Jewish nation completely. Also, during both of those exiles God sent a individual to save them; Moshe saved the Jews of Egypt, while Mordechai saved those of Persia. After each brush with fate the Jews reaffirmed their devotion to Hashem. Following the Egyptian exile the Jews accepted the Torah and after the Persian one "the Jews ordained and took upon themselves..." (Esth. 9:27) as the Gemara Shabbat (88a) explains, "they reaffirmed their commitment to the Torah as they had done previously [at Sinai]."
Both exiles are kept fresh in our minds through annual ceremonies. The Seder on Pesach night and the reading of the Megillah on Purim both remind us of the reaffirmations of faith which occurred as a result of the two "close calls."
Many Midrashim try to explain the purposes of these two exiles. Judaism does not accept the possibility of chance or coincidence, especially regarding events which affect the nation as a whole. An event which one may interpret negatively as an accident at the time of its occurrence may actually appear positive from a different vantage point years down the road. Looking into the past we can discern the moral lessons that the two exiles impressed upon the Jews. Moshe himself realized this concept when he asked God to show him His face, in other words, His reasons for doing things the way He does them in Shemot (33:18‑23). Hashem responded "You can not see My face, for you can not see Me and live. But as My Presence passes by, I will put you in a cleft of the rock...and you will see My back; but My face shall not be seen." Moshe learned that events may not always make sense when they occur, but it is easier to comprehend why they occur in retrospect.
Only from a historical distance may we arrive at some appreciation of the enduring influences which Galut Mitzraim and Galut Persia have had upon the Jews.
The first Jewish exile molded twelve tribal families into one unit. They entered fragmented and emerged united. The exile also showed God in the birth of the Jewish people and His concern in their destiny. In Devarim we see another possible reason "But You the Lord took and brought out of Egypt, that Iron furnace to be His people of inheritance as you are this day." (4:20) Rashi explains that this "iron furnace" designates a vessel that refines gold. The suffering in Egypt was apparently intended to refine and cleanse the Jewish character, and to heighten the ethical sensitivity. This metaphor was also used by Yishaia "Behold, I have refined you, but not as silver; I have tried you in the furnace of afflictions" (48:10) The Egyptian exile may be viewed as a necessary experience which molded the moral quality of the Jewish people for all time.
The Torah teaches us to be nice to converts orphans and widows. Whenever the Torah wishes to impress upon us the idea of compassion and sympathy for those who are oppressed, it reminds us of our helplessness and low status we had in Egypt. The Egyptian experience may be regarded as the fountainhead and moral inspiration for the teaching of compassion which is so integral to the Jewish life.
The Persian exile also served to teach the Jews many things. Firstly it answers the question of: Can it happen here? The Jews of Persia probably were asking themselves that question just as many Jews do today in different parts of the world. Jews must learn from Persia that "Yes it can happen here and elsewhere, as it has occurred in the past." The ethical sensitivity of Jews imprisoned in Egypt and reinforced in Persia should not blind the Jews to the surrounding realities. Amalek is a repeating historical occurrence. "Lo Tishkach" ‑ the lesson must never be forgotten.
The Persian exile also demonstrated the common destiny of the Jews. The hatred for the Jews does not emerge from a logical political or economical reason. It is the mere existence of a Mordechai which upsets Haman. No one has a virulent hatred for France or the United States, but the existence of the Jews seems to attract mass persecution. Haman demonstrates this "Yet all this [honor] is worthless to me, so long as I see Mordechai, the Jew, sitting at the kings gate" (Esth. 5:13). At the time of the persecution the Jews came together. The transfer of the ring to Haman was more effective in uniting the Jews in religious repentance that the forty‑eight prophets and seven female prophetesses, who were unable to turn Israel to better courses.
During the first commonwealth the Jews were divided into Yehudah and Israel which at times even fought with each other. God wanted them united. Thier approaching destiny became clear to all Jews. Different sects of Judaism are constantly fighting and demeaning one another. Jews don't overlook the differences among themselves. The people who show the strongest unity amongst the Jews are the persecutors! Egypt, Haman and Hitler did not care what type of Jew you were. They united the Jews beyond what the Jews themselves could comprehend. It was the ultimate unity. A unity in destiny and in death.
A final demonstration of Galut is that God does not abandon his people. No matter how bad things seem for the Jews, Hashem will always save them. The Jews are compared to the moon. It gets smaller and smaller, but always returns to its prominent glowing state.
The suffering of the Jews in Galut taught the Jews many important lessons about themselves and God. They became strengthened through the suffering. We are constantly being placed in situations which are less then ideal. Even though at the moment of its occurrence we can not "see its face" after it passes we can learn from "its back." One should stand up to the occurrences which befall him and learn from them as they go by. Everyone has these occurrences, in marriage or otherwise, and one should emerge stronger from the challenge than they were when they entered.