Solomon, as a man who had labored with wisdom, knowledge, skill, and striving and would leave the issue of his labor to a man who had not labored, hated all his labor under the sun and despaired of it because he would leave his gain to the man after him, considering it a great evil, sorrow, and vexation that caused his heart to have no rest in the night. Hence, all this was vanity and a chasing after wind to him (vv. 18-23).
Solomon considered that nothing is better for man than to eat, drink, and make his soul taste enjoyment in his labor and recognized that this is from the hand of God, who gives wisdom, knowledge, and joy to the man who is good in His sight (3:13; 5:18-20), but to the sinner, the travail of gathering and heaping up for him who is good in God's sight. To him this also was vanity and a chasing after wind (2:24-26).
In 3:1-15 we have a word regarding the experiment in fate under God's sovereignty.
There is a season for everything, appointed by God. What profit does the worker have in all that he labors? (vv. 1-9).
Solomon goes on to list the reasons why God appointed a season for everything.