3 What then is, “Understanding to David himself”? David indeed was, as we know, a holy prophet, king of Israel, son of Jesse: but because out of his seed there came for our salvation after the flesh the Lord Jesus Christ, often under that name He is figured, and David instead of Christ is in a figure set down, because of the origin of the Flesh of the Same. For after some sort He is Son of David, after some sort He is the Lord of David; Son of David after the flesh, Lord of David after the divinity. For if by Him have been made all things, by Him also David himself has been made, out of whose seed He came to men. Moreover, when the Lord had questioned the Jews, whose Son they affirmed Christ to be, they made answer, “David's:” where the Lord chides the Jews, when they said that He was the Son of David. He saw that they had stayed at the flesh, and had lost sight of the divinity; and He reproves them by propounding a question: “How then does David himself in spirit call Him Lord, 'The Lord has said unto my Lord.'...If then He in spirit calls Him Lord, how is He is Son?” A question He propounded; His being Son He denied not. You have heard “Lord;” say ye how He is his “Son:” you have heard “Son;” say how He is “Lord.” This question the Catholic Faith solves. How “Lord”? Because “In the beginning was the Word, and the Word was with God, and the Word was God.” How “Son”? Because “The Word was made flesh, and dwelt among us.” Because then David in a figure is Christ, but Christ, as we have often reminded your Love, is both Head and Body; neither ought we to speak of ourselves as alien from Christ, of whom we are members, nor to count ourselves as if we were any other thing: because “The two shall be in one flesh.” “This is a great Sacrament,” says the Apostle, “but I speak in regard of Christ and the Church.” Because then whole Christ is “Head and Body;” when we hear, “Understanding to David himself,” understand we ourselves also in David. Let the members of Christ understand, and Christ in His members understand, and the members of Christ in Christ understand: because Head and Members are one Christ. The Head was in heaven, and was saying, “Why do you persecute Me?” We with Him are in heaven through hope, Himself is with us on earth through love. Therefore “understanding to David himself.” Be we admonished when we hear, and let the Church understand: for there belongs to us great diligence to understand in what evil we now are, and from what evil we desire to be delivered, remembering the Prayer of the Lord, where at the end we say, “Deliver us from evil.” Therefore amid many tribulations of this world, this Psalm complains somewhat of understanding. He laments not with it, who has not understanding. But furthermore, dearly beloved, we ought to remember, that after the image of God we have been made, and that not in any other part than in the understanding itself. For in many things by beasts we are surpassed: but when a man knows himself to have been made after the image of God, therein something in himself he acknowledges to be more than has been given to dumb animals. But on consideration of all those things which a man has, he finds himself in this thing peculiarly distinguished from a dumb animal, in that he has himself an understanding. Whence certain men despising in themselves that peculiar and special thing which from their Maker they had received, the Maker Himself reproves, saying, “Do not become like horse and mule, in which there is no understanding.”...
4. “Hear Thou, O God, my entreaty, and despise not my prayer: give heed unto me, and hearken unto me”. Of one earnest, anxious, of one set in tribulation, are these words. He is praying, suffering many things, from evil yearning to be delivered: it remains that we hear in what evil he is, and when he begins to speak, let us acknowledge there ourselves to be; in order that the tribulation being shared, we may conjoin prayer. “I have been made sad in my exercise, and have been troubled”. Where made sad, where troubled? “In my exercise,” he says. Of evil men, whom he suffers, he has made mention, and the same suffering of evil men he has called his “exercise.” Think ye not that without profit there are evil men in this world, and that no good God makes of them. Every evil man either on this account lives that he may be corrected, or on this account lives that through him a good man may be exercised. O that therefore they that do now exercise us would be converted, and together with us be exercised! Nevertheless, so long as they are such as to exercise, let us not hate them: because in that wherein any one of them is evil, whether unto the end he is to persevere, we know not; and ofttimes when to yourself you seem to have been hating an enemy, you have been hating a brother, and know not. The devil and his angels in the holy Scriptures have been manifested to us, that for fire everlasting they have been destined. Of them only must amendment be despaired of....Therefore since this rule of Love for you is fixed, that imitating the Father you should love an enemy: for, He says, “love your enemies:” in this precept how would you be exercised, if you had no enemy to suffer? You see then that he profits you somewhat: and let God sparing evil men profit you, so that thou show mercy: because perchance thou too, if you are a good man, out of an evil man hast been made a good man: and if God spared not evil men, not even you would be found to return thanks. May He therefore spare others, that has spared you also. For it were not right, when you had passed through, to close up the way of godliness.
Source: The Enarrations, or Expositions, on the Psalms (New Advent)