Ecclesiastes goes into more detail on his drunken escapades. He says that he tried to pursue pleasure, and perk up with wine—but all the "vanity" was still getting to him. It didn't help. While still holding on to wisdom, he says he investigated its opposite, folly.
He describes how hard he worked as a king, and how many possessions he amassed. He chalks up all the gardens and vineyards he planted, all the slaves and gold and silver he bought, and the concubines he also obtained.
He says that work made him happy—at least, for a time. But in the end, it was all still "chasing after wind."
Yet, he says it's still better to be a wise man than to be a fool. True, both are just going to die and no one will remember them forever. But the wise man is clear about what is going on around him, while the fool is just living in delusions, bouncing along without really knowing what's up. He has no street smarts.
Now, Ecclesiastes says he got sad. He probably went back into his throne room, pulled down the blinds, popped open an iced tea, and had a long, sad think. He was in despair about the meaning of life. All the work and toil that had seemed valuable, now felt like a waste of time.
But guess what—he says this despair stuff's all just vanity too. Hey, we know what Ecclesiastes's word of the day is. (Pssst: it's actually vanity—not "treestar.")
All the trouble and pain people get from their toil is vanity, too. Even when they're trying to get to sleep, their minds are still going a-mile-a-minute. And that's just more vanity, "mere breath."
He ends the chapter by saying that he realized there was nothing human beings could really do except continue to enjoy the things God had given them—eating and drinking—and continue working.
The Teacher says that God gives these things, and lets some people enjoy them. But others don't get the benefit. He sort of shrugs at this, and calls it more "vanity" and "chasing after wind." It's all a toss-up.