Ecclesiastes 2:21 (ESV)

21 because sometimes a person who has toiled with wisdom and knowledge and skill must leave everything to be enjoyed by someone who did not toil for it. This also is vanity and a great evil.

What Solomon describes here is also what would happen later when his son Rehoboam succeeds him. When Solomon dies, Rehoboam becomes king. When he takes over the kingship, the people come to him to ask him to impose fewer burdens on them than his father had done. Rehoboam’s unwise response to this request ensures that most of the people of Israel no longer recognize the house of David as their royal house. The greatness and glory of Solomon’s kingdom disappears. Rehoboam is left with only the Two-Tribe Kingdom as the area over which he rules (see 1 Kings 12:1–33).

That’s not even the end of it. Rehoboam also lives in unfaithfulness to the Lord. As a result, Egypt’s King Shishak marches against Jerusalem. The treasures from the temple and from the king’s palace come into the possession of Shishak. The golden shields that Solomon had made also end up in the hands of the enemy (see 2 Chronicles 12:9).

Solomon’s wealth disappears like snow before the sun. His successor squandered it through his lack of wisdom and loyalty. The Preacher knows that one’s successor can wreck much of what one has built up. Then, what did you work for? It can make you despairing and depressed.

It is already very difficult to entrust what you yourself have built to someone else. You are so attached to it. Yet you have to do it at least once in your life. You are getting too old or too weak to do everything right. Sometimes, at the end of your life, it seems as if you have worked for nothing. If you don’t look beyond life on this earth, everything seems to be in vain.

When you live with Christ, he shows you that your work and life are not in vain. What you have done in your life in love and obedience to Christ is never in vain! It has eternal value through the sanctifying work of Christ’s blood. It will have value, even on the new earth. We read in Revelation 14:13, And I heard a voice from heaven saying, Write this: Blessed are the dead who die in the Lord from now on. Blessed indeed, says the Spirit, that they may rest from their labours, for their deeds follow them.