The Yalkut Shimone, paraphrasing from a Medrish Rabba in the Torah portion of Vayera, says: “Hashem does not leave righteous people suffering more than three days. That is why it says ‘He will revive us from the two days, on the third day He will set us up, and we will live before Him’ (Hoshea 6:2). By the third day of the tribes it says, ‘Yosef said to them on the third day’ (Breishis 42:18). On the third day of Yonah, ‘Behold Yonah was in the stomach of the fish for three days’ (Yonah 2:1). The third day of those who made aliyah from [Babylonian] exile, ‘And they rested there for three days’ (Ezra 8:15). On the third day of the resurrection of the dead it says, ‘He will revive us from the two days’ (Hoshea 6:2). The third day of Esther, ‘It was on the third day, and Esther wore royalty’ (Esther 5:5). With which merit was all this merited? The Rabbis said the merit of the third day when the Torah was given, ‘And it was on the third day when it was morning’ (Shemos 19:16). Rebbe Levi says in the merit of the third day of Avraham as it says [by Akeidas Yitzchak] ‘On the third day Avraham lifted up his eyes’ (Breishis 22:4).” (Click here for Hebrew text.)
The Matnas Kehuna points out that by Yosef and his brothers, when he first saw his brothers in Egypt, he threw them in jail for three days, and when he freed most of them it revitalized them and gave them contentment. So too by all the other examples; meaning, Hashem does not leave righteous people suffering for more than three days. (Click here for Hebrew text.)
The Etz Yosef, quoting the Yefeh Toar, says that the reason why the Rabbis learn it from the receiving of the Torah is because of the merit of many and Rebbe Levi learns it out from Avraham for he was the first. The Maharz”u points out that according to the Rabbis who says all those people who stopped suffering after three days was in merit of the receiving of the Torah, we must say “that in merit of the Torah that their children will in the future receive” was the reason why Yosef’s brothers were relieved of suffering in jail after three days. (Click here for Hebrew text.)
What we see here is something quite profound, if you think about it. Hashem is beyond time and space. Taking that into account, it makes sense that Hashem rewards good deeds, whether the deed happened in the past or is yet to happen;, the merit of that deed can be applied in either direction. Furthermore, the reward in this case, measure for measure, is not connected to the deed itself; it is connected to the timing of the deed. The Jewish people just happened to accept the Torah three days after Hashem told them to make preparations. Avraham just happened to be traveling for three days and realized the place in front of him was where he was to perform Akeidas Yitzchak. There was no positive act on the third day itself.Meaning, the third day had nothing to do with their decisions to do those meritorious deeds; yet, since they are connected to the meritorious deeds, measure for measure, for all time past and present, righteous people felt the rewards being reaped for what happened on the third day. That is the power of a zechus, or merit!
What is even more amazing is that, according to Rebbe Levi, the good deed of even one individual could have this type of impact and ramifications on the entirety of history! This should give us an entirely new perspective on the merits we can accrue for ourselves and our loved ones throughout history, by the many good deeds we can potentially accomplish.