Ecclesiastes 12:8,13-14 (NKJV)
"Vanity of vanities," says the Preacher, "All is vanity."
Let us hear the conclusion of the whole matter: Fear God and keep His commandments, For this is man's all. For God will bring every work into judgment, Including every secret thing, Whether good or evil.
The whole book of Ecclesiastes is this philosophical look at life as this empty, meaningless, and perplexing pursuit of satisfaction which is never achieved. Solomon documents all of his own personal pursuits and is left empty on all counts. This is from the perspective of a natural man "under the sun" who figures that we might as well "eat, drink and be merry for tomorrow you die." Mixed in throughout the book are references to God whom Solomon credits as the Giver of all things. The key to the book is found in these last few verses, where Solomon resolves the whole investigation into the meaning of life: "Fear God and keep His commandments, for this is man's all."
Notice the last sentence in the verse. It says that every secret thing, both good and evil will be judged. If we were judged only by what you can see on the outside, we might fare pretty well in the world's eyes. It is the deep motivations inside that are so evil, we don't even notice them. God sees them. Solomon makes reference to a Shepherd in the following verse:
Ecclesiastes 12:11 (NKJV)
The words of the wise are like goads, and the words of scholars are like well-driven nails, given by one Shepherd.
Man's fulfillment and salvation from his evil works are found in the "One Shepherd," Jesus Christ who said:
John 10:11 (NKJV)
I am the good shepherd. The good shepherd gives His life for the sheep.