Solomon was the wisest and richest king Israel ever had. He could have literally anything he wanted.
And he tested everything: he built palaces and gardens, gathered gold and silver, lived every party and every pleasure. If something promised happiness, Solomon tried it.
In the book of Ecclesiastes, he tells the result of this giant experiment. And the answer is surprising.