Solomon addresses an apparent inconsistency. Sometimes it appears like wicked people prosper despite what we believe about God's justice. But there is much more to the story. He observed that a wicked sinner may seem to have a full life, but that really amounts to nothing without God.
What the Preacher knows is that real satisfaction of soul abides with those who fear God. God is their source, their sustaining life, and their joy. Because of this they do well... more so than someone who only has the stuff of this world.
That same observation can be made today. Wealth and worldly success mean nothing in comparison to knowing the pleasures of God. Fearing God is its own reward because those who do so have God as their king. And God has everything.