Psalms 73:22

So foolish was I, and ignorant: I was as a beast before thee.

The verse is David's own confession of foolishness and ignorance before God, in which he describes himself as having acted toward God like an unreasoning animal. His misjudgment arose when he saw transgressors and sinners allowed blessings and favors, while those who truly love God were compassed with difficulties and perplexities that the open sinner does not have. From that contrast he concluded that God's ways were unequal, and he became envious at the prosperity of the wicked.

He could not understand the matter until he went into the sanctuary of God, where he came to understand the end awaiting the wicked. That end is that God sets them in slippery places on unstable ground, and casts them down to sudden desolation and terror. With his heart grieved and pricked by that light, he condemns his own envy and complaint as brutish ignorance before God.