8:14 There is a vanity which is done upon the earth; that there are just [men], to whom it happeneth according to the {m} work of the wicked; again, there are wicked [men], to whom it happeneth according to the work of the righteous: I said that this also [is] vanity.
(m) Who are punished as though they were wicked, as in Ec 7:17
8:14 Done - Either by wicked potentates, who do commonly advance unworthy men, and oppress persons of greatest virtue and merit: or, by God's providence, who sees it fit for many weighty reasons so to manage the affairs of the present world. To whom - Who meet with such usage as the worst of men deserve. It happeneth - Who, instead of those punishments which they deserve, receive those rewards which are due to virtuous men.
8:14-17 Faith alone can establish the heart in this mixed scene, where the righteous often suffer, and the wicked prosper. Solomon commended joy, and holy security of mind, arising from confidence in God, because a man has no better thing under the sun, though a good man has much better things above the sun, than soberly and thankfully to use the things of this life according to his rank. He would not have us try to give a reason for what God does. But, leaving the Lord to clear up all difficulties in his own time, we may cheerfully enjoy the comforts, and bear up under the trials of life; while peace of conscience and joy in the Holy Ghost will abide in us through all outward changes, and when flesh and heart shall fail.