"For to the man who is good before Him, He gave wisdom, knowledge, and joy; but to the sinner He gave the task to gather and to amass, to give to one who is good before God. This, too, is vanity and herding wind" (Ecclesiastes 2:26). A verse that seems to echo through the ages.

But what does it really mean?

Kohelet Rabbah, a classical midrashic (interpretive) text on Ecclesiastes, unpacks this verse in a fascinating way, offering a series of examples from our history. It's not just about random chance, but about a deeper pattern of divine justice, where ultimately, what is accumulated by the wicked benefits the righteous.

First, we have Abraham, our patriarch. According to Kohelet Rabbah, he is the "man who is good before Him," blessed with wisdom, knowledge and joy. Who then, is the sinner who gathers and amasses? None other than Nimrod, the infamous king known for his hubris and rebellion against God. And who ends up benefiting from Nimrod's efforts? Abraham, of course! "The Lord blessed Abraham with everything," as we read in Genesis 24:1.

But the midrash doesn't stop there. It finds the same pattern repeating itself throughout our history.

Next, we have Isaac, Abraham's son. He too, is the "man who is good before Him," blessed with divine favor. His counterpart? Avimelekh, king of the Philistines. Remember the story? Isaac sows in the land of the Philistines and reaps a hundredfold harvest – a clear sign of God's blessing (Genesis 26:12). Avimelekh's wealth ultimately pales in comparison to the blessings bestowed upon Isaac.

Then comes Jacob. He embodies the "man who is good," while his scheming father-in-law, Laban, plays the role of the "sinner." As Genesis 31:12 tells us, God intervened to ensure Jacob received what was rightfully his, even diverting Laban's livestock to Jacob. Kohelet Rabbah sees this as another instance of the wicked's wealth ultimately benefiting the righteous.

But it's not just about individuals. The midrash also applies this principle to entire nations.

Think about the Israelites in Egypt. They are the "men who are good," receiving wisdom, knowledge, and joy. The Canaanites, on the other hand, are the "sinners," obsessed with hoarding wealth. Rabbi Levi, as quoted in Kohelet Rabbah, paints a vivid picture of their miserly ways: they wouldn't even add a drop of oil to their beans! Why? Because they were so focused on accumulating wealth that they deprived themselves, all so that when the Israelites finally entered the land, they would find it overflowing with blessings. Ultimately, the land was distributed to the Israelites, as Numbers 26:53 states.

The pattern continues. We see it with Hezekiah, the righteous king of Judah, and Sennacherib, the arrogant Assyrian king who threatened Jerusalem. Hezekiah was "exalted in the eyes of all of the nations," (II Chronicles 32:23) while Sennacherib's vast armies were miraculously defeated.

And finally, the story of Mordechai and Haman from the Book of Esther. Mordechai, the righteous Jew, is elevated to a position of power, while Haman, the wicked antagonist, is brought down. As Esther 8:1-2 recounts, King Ahasuerus gives Esther the house of Haman, and Mordechai is put in charge of it. The wealth Haman sought to use for evil ends up benefiting Mordechai and the Jewish people.

So, what's the takeaway from all of this? Is it simply a cosmic accounting system, where good deeds are rewarded and bad deeds are punished? Perhaps. But maybe it’s also a reminder that true wealth isn’t just about accumulating possessions. It's about wisdom, knowledge, joy, and living a life that is "good before Him." And ultimately, maybe, just maybe, the universe has a way of ensuring that those who prioritize these things will ultimately inherit the earth – or at least, its blessings.