I think that Solomon, “Son of David”, wrote the book of Ecclesiastes out of the sheer frustration of being such a wise one among regular humans! Upon his being seated as King he was given the opportunity to ask God for anything! He asked for God's Wisdom to attend him. As a result he was one of the most wealthy, successful, and renown rulers in Israel.
As he lived this “good life”, however, he saw the utter futility of the ways of the flesh, even his own. Though he had been granted the wisdom of a Godly perspective, and the grace and anointing to build God's place of Worship, he still observed the negative side of things, even such great success. So he grew exhausted from observing the foolishness of human “reasoning”. I think at times he even despaired of life. Ecclesiastes seems to be a coping mechanism, in which Solomon was attempting to find the balance of the human “normal” reality and the God-inspired Kingdom expectation.
I get the feeling that the book of Ecclesiastes was a kind of self-therapy for Solomon, like much of my writing is for me. It isn't really instruction for anyone else. Of course it can be, if anyone is wise enough to tune in, and willing to consider a different perspective than their own. But the book of Ecclesiastes is a dissertation on the futility of the fleshly life.
“All is vanity...” he keeps repeating – meaning that it is all worthless, pointless, endless, meaningless. The end observation, the point of it all, of course, is that this life is NOT the point! This life is a simple opportunity to find God, and get transformed from the temporary fleshly, pointless, existence to the ETERNAL, GOD-DRIVEN, enduring goal of being WITH our God, and to be LIKE Him – once again reflecting HIS IMAGE, not this fallen, terminally stupid flesh! The point of all existence then, is to return to our Creator, and to KNOW HIM, and to find our place in HIS REALM, FOREVER.
The point King Solomon, The Wise, was trying to make is this. Don't invest everything in this temporal realm. It just isn't going to give back what we've invested. We can never fill that hauntingly empty space in our souls with the stuff this planet has to offer. Human “love” is deceptive, deficient, and disappointing. And stuff is only stuff. It can give us nothing that is intrinsically valuable! The longing of every created heart is The GOD who created them. If we strive after anything it should be getting to KNOW HIM. We should take full advantage of the Sacrifice of Yeshua, our Lord and Savior, and walk through The WAY that HE has opened for us. HE has arranged the means to return to our Father. HE has provided the KEYS to that gate, which once prevented our entry. He has thrown wide the Kingdom of God to US.
It is, as King Shl'mo, points out, total futility to strive, to invest much, to find one's happiness on this planet. We may have a “right” to “the pursuit” of it, but according to the King it is an exercise in total frustration, in which we will invest much to reap little. The pursuit of happiness in this natural, temporary realm, is just a waste of our time. The only real JOY that we humans will ever find, that is sustainable, maintainable, and worth our efforts, is the time we put into seeking God, and bringing His Kingdom to earth. That where our fulfillment lies, an as he puts it, all else is indeed “vanity of vanities”.