Solomon investigated hard work as a possible way of supplying meaning to life. He realized, however, that if he worked, at the end of his life he would have to leave all the fruit of his labors to people who had not worked. He concluded that this would be foolish and extremely unfair.
Besides, he goes on to say, work only brings a person pain and difficulty sleeping at night-particularly if the person has been loading camels all day and has only a lumpy mattress to go home to in the evening. Solomon realized that there was some satisfaction to be found in work.
This satisfaction comes straight from the hand of God. People should enjoy the reward of their labor because such fruits are a gift from God (Ecclesiastes 3:13)
ECCLESIASTES 2:22-23 – 22 For what hath man of all his labour, and of the vexation of his heart, wherein he hath laboured under the sun?
23 For all his days are sorrows, and his travail grief; yea, his heart taketh not rest in the night. This is also vanity.