The Gemara (Sotah 8a) states: “It was taught in a Bariata: Rabbi [Yehuda Ha’Nassi] would say, ‘The measure one uses is used to measure against him.’” This means that way one behaves is the way one is treated by Heaven. Indeed, the Gemara (Shabbat 151b) states, “One who has pity on others is pitied by Heaven.” We find this idea multiple times in the teachings of our Sages that the wicked are punished in a manner similar to how they have sinned while the righteous are rewarded in a manner similar to the good deeds they have performed.
It is for this reason that the Mishnah states (Sanhedrin 90a) states, “The following are those who do not have a share in the World to Come: One who denies that the Resurrection of the Dead is based on the Torah etc.” This means that one who claims that it is unclear based on the Torah whether or not the Resurrection of the Dead will actually occur will not merit awakening during the Resurrection of the Dead. The Gemara explains that this is so because Hashem acts by the principle of measure for measure and since this individual denied the Resurrection of the Dead, he will not arise during the Resurrection of the Dead.
The opposite is true as well regarding the reward Hashem gives the righteous in that the Gemara (Shabbat 118a), “Rabbi Yochanan said in the name of Rabbi Yose: One who causes Shabbat to be enjoyable will be given boundless inheritance, as the verse states, ‘Then shall you delight in Hashem and I will make you ride upon the high places of the earth and I shall feed you the heritage of Yaakov your father.’” Similarly, the Gemara explains that one who causes Shabbat to be enjoyable and takes care to observe it will be saved from the bondage of the kingdoms and is granted his heart’s wishes. Maran Ha’Bet Yosef (Chapter 242) writes in the name of Rabbeinu Yitzchak Abohav that the “boundless inheritance” one will receive is measure for measure, for just as one spent money generously in honor of Shabbat, so too, one will be given boundless inheritance in a generous manner as well. Similarly, the reward of being saved from the bondage of the kingdoms is likewise measure for measure, for since one has accepted upon himself the yoke of Shabbat, the yoke of the kingdoms is removed from him. Similarly, one’s heart’s wishes are granted so that one may receive any enjoyment one wishes.
Several months ago, Hagaon Harav Aharon Leib Shteinman zt”l departed from this world. The Sefer “U’Matok Ha’Ohr” recounts a terrible story regarding the idea of “measure for measure.” Once, a Kollel fellow came before Hagaon Harav Shteinman zt”l and told him that his wife had given birth to a child with a terrible defect in that he was born with only half a tongue (Hashem Yerachem). Their next child was born and suffers from a similar defect in his tongue. Now, his wife was pregnant again and the doctors told her to immediately seek genetic testing to determine how to proceed. The Kollel man asked the Rav what to do.
When Rav Shteinman heard the question, he immediately responded to the Kollel man, “You have a problem with your tongue! You have sinned terribly with your tongue!” The fellow replied, “I have probably spoken Lashon Hara (evil speech).” The Rav replied, “No. Many people speak Lashon Hara. One is not usually punished for Lashon Hara in this manner.” The man asked, “If so, what sin is the Rav referring to?” The Rav answered, “I do not know. Think about it by yourself.” The Kollel man went home upset and dejected.
The next day, this man returned to the Rav and told him that he remembered that in his youth, he had caught pigeons on the roof of his house (since pigeons can sometimes be a great nuisance) and tore off their beak. The Rav heard this and immediately responded, “That is the sin for which you were punished!” When the man heard this, he confessed his sin and cried copiously and repented fully. Indeed, his wife ended up giving birth to a completely healthy baby boy. (This story was so unique that Hagaon Harav Shteinman zt”l felt it necessary to tell it over himself.)