Solomon had observed the final end of the wicked. Their lives contrasted greatly with their deaths.
Men and women in various ways try to build a reputation on earth and exert themselves for a reward that they cannot enjoy more than a few years. Their worship is vanity, their righteousness is vanity, all their efforts to win the praise of men are vanity, and indeed their whole lives are vanity and death is the instrument that final exposes the vanity. True religion is not something that can be fabricated. All worship acceptable to God must be by the Spirit. There is therefore no alternative but to come to God and seek him with all our hearts. True conversion involves dying to sin, and there is no way to avoid this. May God help men and women to let go of the vanity to which they cling and come to him for life.