The Shach on the Torah writes that he heard from a Mekubal that the brother’s sale of Yosef to Mitzrayim had a positive effect on the future generations and the destiny of AmYisraelChazal tell us that when Yisrael have angered Hashem to the point when He was ready to annihilate Am Yisrael completely, He instead released His anger on wood and stones – the Beis Hamikdash, and destroyed it.
This thought originates in Aicha 4,11 כלה ה’ את חמתו שפך חרון אפו ויצת אש בציון  and the Medrash comments on the passuk מזמור לאסף אלקים באו גויים בנחלתך that the word מזמור  (song) appears inappropriately, for the invasion of our enemies is not a time for song and rejoicing but rather a time for lamentation? The silver lining of the invasion was that they destroyed the Beis Hamikdash the wood and the stones and not Yisrael whom they exiled with them to Bavel. ויצת אש בציון.
It is true that Am Yisrael received an alternative punishment that of Galus amongst the nations but won’t they become extinct through the natural process of assimilation? So why destroy the Beis Hamikdash and send Yisrael to Galus which will be to no avail to spare from annihilation. The answer to this is that the Shechinah followed Yisrael into the galusand therefore it protected them from assimilation. The impetus for the Shechinah to place itself into galus on behalf of Am Yisrael was first initiated with the brother’s sale of Yosef to Mitzrayim. From the passuk (Devarim 33,16) ורצון שוכני סנה which is found in Moshe Rabbeinu’s beracha to Yosef, there is a mention of Hashem’s willingness to dwell in the סנהwhich is referring to Hashem’s appearance to Moshe in the Burning Bush. The Chazal ask why did Hashem choose to speak to Moshe through this specific conduit. The answer is a thorn bush symbolizes pain and Hashem was demonstrating to Moshe that He also feels Yisrael’s pain of bondage,עמו אנכי בצרה . One might ask why does the resting of the Shechinah in galus, find mention specifically in Yosef’s beracha. The answer is that Yosef was the first of the Shevatim to descend into Galus and Hashem accompanied him there to protect him as we see from the passuk ויהי ה’ את יוסף (Bereishis 39,2) the Shechinah was with Yosef. Also the gematriah ofויוסף הורד מצרימה  is a proof, since it is the gematriah of שכינה.
Now that the Shechinah already went into galus with Yosef, it was only a repeat to go once again into galus with Yisrael in the future galuyos. Yosef’s galus therefore removed the alternative of Hashem’s outright destruction of Yisrael and instead the Beis Hamikdash and galus took their place. The Taam Tzvi writes that this idea is hinted in the words above ויצת אש בציון. The word ציון  is gematriah יוסף. The Beis Hamikdash and Yosef are intertwined. Hashem was able to burn the Beis Hamikdash and send Yisrael to galus instead of destroying them, all because of ציון through Yosef. We can add to the remez that יוסף  with his four letters equals עץ wood. Because of Yosef’s galus the wood of the Beis Hamikdashwas set on fire and the Yidden went to galus instead of being exterminated.
Now we can understand why Reuven saved Yosef from being killed when he told the brothers אל תשפכו דם, but rather throw him into a pit. There are those who learn that Reuven took the initiative to save Yosef because of the middah of הכרת טובה. They explain that after Reuven removed his father’s bed from the tent of Bilhah and placed it by his mother Leah, he was concerned that due to his actions he was ousted from the Shevatimand he had no longer a destiny together with Am Yisrael. However, when Yosef told his dreams to the brothers and Reuven heard the part of the dream that revealed eleven stars and sheaves of wheat bowing down to Yosef, he then realized that he is still counted as being part of Am Yisrael, for otherwise Yosef would have changed the number to ten stars and sheaves. As far as Reuven was concerned, Yosef took him back from the dead, for losing being part of Am Yisrael was tantamount to being dead. Therefore he felt an obligation to do the same for Yosef and bring him back from imminent death and deliver him from the hands of his brothers.   
By Reuvein saving Yosef from death, Yosef was able to save all of them and future generations from death. As we explained above had Yosef not have gone to galus then Hashem would not have destroyed the Beis Hamikdash, and Yisrael would have all perished instead.
In the Torah we find the episode of Yehudah and Tamar juxtaposed with the selling of Yosef (see Rashi). According to what we explained the connection is outsanding. The purpose of the Yehudah and Tamar episode was to bring about the Moshiach as the Medrash says והקב”ה עוסק בורא אורו של משיח. Only after Yosef was sold and Hashem went to galus to accompany him, then the coming of Moshiach was guaranteed to become actualized. For even if it were to be that Yisrael would stray from Hashem’s path, Hashem would not destroy them but rather efface the Beis Hamikdash and send Yisrael into galusaccompanied by Him and ultimately the Moshiach will bring the final geulah.
 This can be alluded to in the words describing Tamar as ותשב בפתח עינים  (Sotah 10). Tamar already experienced the two deaths of her husbands, Yehudah’s children. She realized that when one sins against Hashem he is punished with death. When she was told through ruach hakodesh that Yehudah left his home to go to Timnas to shear his flock she was instructed to bring about Moshiach with Yehudah. What convinced her to go and degrade herself masquerading as a harlot and having relations with her father in law. No one is perfect and there will come a time when the future Klal Yisrael will sin and Hashem will destroy them just as He did to Yehudah’s children the seeds of Moshiach. Who can guaranteed that this experience that I am about to undergo will bear any fruit in the future.
The Ari Hakadosh says that the months of the year correspond to the organs of the human head. The eyes represent the months ofתמוז אב , the two months in which the destruction of the Beis Hamikdash occurred (the Three Weeks). The passuk says עיני עיני ירדה מים My eyes my eyes have given forth tears. The sefarim write that this crying with two eyes עיני עיני refers to the two months of the Churban Beis Hamikdash.
Therefore the Torah goes on to tell us ותשב בפתח עינים that the reason she did this deception specifically now in order to bring about the seed of Moshiach, was because she saw in ruach hakodesh that there will two months in the Jewish Calendar, the months of Tammuz and Av עיניים)) when there will be mourning over the destruction of the two Batei Mikdashos. It is obvious from this that Yisrael must have sinned horrifically is Hashem decided to destroy His resting place for the Shechnah. But why didn’t he destroy them? The answer is that He let out his wrath of the wood and stones of the Beis Hamikdash and sent them into galus instead. How did they survive in galus and not assimilate. It must be because Hashem went down to galus with them to protect them.
In the light of the above we can understand better the meeting between Yosef and Binyamin. The Torah relates that when the two brothers met they fell on each other’s neck and wept. Rashi explains they cried for the future destruction of the two Beis Hamikdashes, one in territory of Binyamin and the other in Yosef’s. Why was it that during this emotional encounter after not seeing each other for over 20 years they cried over the destruction of the Beis Hamikdash? We suggest a novel interpretation. They were not reactive tears to a tragedy but rather an outpouring of tears of simcha after achieving an incredible milestone. When Binyamin saw Yosef that he remained a tzaddik even in this decadent land against all odds, he understood that the Shechinah must have always been by his side to ensure that he would not assimilate. This benevolence of Hashem to be with him in the galus was a guarantee for the eternity of Am Yisrael. For even if we would rebel against Hashem, nevertheless, He will not annihilate us for our waywardness. Rather He will use a substitute mode of punishment which is to destroy the Beis Hamikdash instead and send us into galus. Both Binyamin and Yosef realized this goal was attained because Yosef was sold by his brothers and Hashem accompanied him during his journey in Mitzrayim. The tears were of the same nature found by the passuk מזמור לאסף באו גויים בנחלתיך that Baruch Hashem He wove together with the Shevatim’s actions a tapestry of events which ended up securing the eternity of Hashem’s nation.
In the beginning of the parsha the passuk says    היה רועה את אחיו בצאן. We can now explain this to have a much more deeper meaning besides the simple understanding that Yosef was teaching his brothers the art of shepherding theצאן  flock (Seforno). The word צאן symbolizes the four galuyos. Rabbe Yehudah Ben Taimah says (Avos 5,20) that the Yid must perfect himself in the four traits of these four animals, the אריה נשר נמר צבי the lion deer leopard and the eagle. The seforim write that these four animals are hinted in the acronym of the wordצאן . We suggest that it is the four exiles that are also hinted in the word צאן. The word צאן as a whole symbolizes the galus of Mitzrayim where the form of avoda zarah was worshipping sheep צאן. Mitzrayim included all the other individual four exiles because it is known as the Galus Kalali. The individual letter ofצ  hints to the צבי the deer which symbolizes the galus of Paras the period of Haman and Achasveirosh who planned to annihilate all of Klal Yisrael. The saviors of that genocide were Mordechai and Esther both of whom symbolize the power of smell. The gemarah (Chullin 139b) learns that the name of Mordechai is alluded to in the spice of מר which the Targum translates as מרדכיא hinting to the name מרדכי. The word מר is gematriah עמלק who was Am Yisrael’sarch enemy during this galus of Paras. While Mordechai is symbolized in the מר the first of the besamim to be mentioned in the Torah, המן in contrast is hinted in the foul smelling besamim of the Ketores called חלבנה  which is also gematriah 95. Esther is also symbolized by a good scent since in the Megillah her name is written also as הדסה which is a myrtle. The Ramban writes that there are those who say that the מר incense forms naturally in the throat of theצבי  the deer. Therefore the deer represents the Galus of Paras in which Haman the chelbanah strove to destroy the מר of Mordechai who through his leadership destroyed Haman instead ונהפוך הוא.
The aleph of the צאן symbolizes Galus Bavel as Nevuchadnetzer is portrayed as a אריה as it is written (Yirmiyahu 4,7) .עלה אריה מסכבו Also (Bereishis Rabba 99,s) on the words in Yirmiyahu אריה מיער the Medrash says it refers to Galus Bavel. The letter nun of צאן  refers to the נמר the leopard which was the third animal that Daniel saw in his nevuah which corresponds to the third galus (6,7) of Yavon. The letter nun also represents the Galus of Edom the eagle נשר. The figure of the eagle was the emblem of the Holy Roman Empire. See Devarim 28,49 Ramban and Medrash Aicha 4,22. It has been used for centuries and became more salient with the Germans and the Nazi Party whose roots are in Edom and Amalek.
Unknowingly to the brothers, Yosef was going to be the individual who was to navigate and spiritually infuse them through the Four Exiles after his experience being sold by them to Mitzrayim the Galus Klali. It was because of Yosef that Am Yisrael, even after they sinned so terribly, would nevertheless survive with the help of Hashem by sending them to galusafter destroying the Beis Hamikdash followed by the Shechinah descending down with them to protect them. That is why the hashgacha in the sale of Yosef as a slave caused that Yosef was sold four times as hinted in the word פסים the acronym of פוטיפר סחרים ישמעאלים מדינים. It was through the sale of Yosef to Mitzrayim which merited Am Yisrael to be preserved as Hashem’s nation beyond any circumstances because Hashem chose for them the option of ויצת אש בציון  and עמו אנכי בצרה.

 Rav Brazil
Gut Shabbos