“There is an evil which is seen under the sun and it is great upon man: A man whom God gives wealth and affluence and great distinction and who lacks nothing before him — even all that he desires — but whom God does not give the opportunity to eat from it because a foreign man eats it. This is vanity and it is a sickening evil.”
We have already seen the situation of a man who has great wealth but had lost them in a poor business decision or who had gambled them away. Here we see the parallel notion being worked through by Solomon. Here is a man who had great wealth but who had no opportunity to enjoy that wealth himself because a “foreign man” would consume it. Several Rabbinical scholars would suggest that this speaks of a man who labors all of his life (we would call him a “work-a-holic”) but who dies without close heirs and then his wife’s second husband is the one who enjoys the fruits of his labors (hence a “foreign” man)
Yet, given Solomon’s use of language here, I would suggest that נָכְרִי (nakriy) is best understood in the more literal sense of someone who is an outsider not to the family, but to the people as a whole (this is the consistent use of the term in the Hebrew Old Testament. Thus, if we understood the term in this fashion and if we understand that the history of the Israelites is marked by being conquered by one invader after another (read the book of Judges, for example), then the evil of which Solomon speaks is that of the nation being overridden by foreign raiders or invaders. And, whether killed in the fighting or taken away into captivity, one will not be able to enjoy the fruit of his labor.
But we would be remiss if we ended there and did not pose the question as to why God permitted all of these invaders to override the land and to create such an evil consequence. And why did this happen? Time after time the people fall into idolatry — basically following the worship of the nations that surround them. God, we are told by God himself, is a jealous God (Exodus 20:5) and he will not share his worship or his glory with any other. And, while we in the west do not typically bow down to idols of gold, silver, stone, or wood, when we import into our worship and practice ideas that are from pagan traditions, then we are guilty of doing much the same as the Israelites did during the time of the Judges. And in turn, God’s judgment upon us as individuals and as a culture will be that we will not enjoy the fruit of our labor. And yes, while we do not have an invading army gobbling up the fruit of our work, between the high taxation imposed by the government and soaring prices for essential goods and services, we might as well be under siege from outside. This too, Solomon says, is vanity and an evil that sickens the stomach when contemplated.