This prayer seems to have been dictated to the faithful when they were languishing in captivity in Babylon. Sorrowful and humbled, they first bewail their afflictions. In the next place, they plead with God for the restoration of the holy city and temple. To encourage themselves to come before him in prayer with the greater confidence, they call to remembrance the Divine promises in reference to the happy renovation both of the kingdom and of the priesthood; and they not only assure themselves of deliverance from captivity, but also beseech God to bring kings and nations in subjection to himself. In the close of the psalm, after having interposed a brief complaint concerning their distressing and afflicted condition, they draw consolation from the eternity of God; for, in adopting his servants to a better hope, he has separated them from the common lot of men.
A prayer for the afflicted, when he shall be shut up, and shall pour out his meditation before Jehovah.
Whoever of the prophets composed this psalm, it is certain that he dictated it to the faithful as a form of prayer for the re-establishment of the temple and the city. Some limit it to the time when, after the return of the Jews from Babylon, the building of the temple was hindered by the neighboring nations; but with this I cannot agree. I am rather of opinion that the poem was written before the return of the people, when the time of their promised deliverance was just at hand; for then the prophets began to be more earnest in lifting up the hearts of the godly according to these words of Isaiah, (Isaiah 40:1) “Comfort ye, comfort ye my people, saith your God.” 133133 “This plaintive poem was written by some pious exile towards the expiration of the seventy years of captivity during which the people of Israel were detained in Babylon. [...] The author of the psalm had most probably been carried away captive in early youth. He had survived nearly to the end of the term, and now, worn with cares and anxieties, he was earnest with God that deliverance might speedily arrive, lest he should sink into the grave without revisiting the delightful scenes by which his imagination was enraptured, without witnessing the fulfillment of the hopes which the prophets of God had excited by the predictions which they had delivered relative to the returning prosperity of his beloved country.” — Walford. Hammond thinks that the psalm was written by Nehemiah, after the return of Ezra with commission for rebuilding the temple. See Nehemiah 1:3, etc. Others ascribe it to Jeremiah or Daniel. The design of the sacred poet was, not only to inspire the people with courage, but also to excite in them greater care about the welfare of the Church. The title of the psalm indicates the end and purpose which it was intended to serve. Those who translate the verbs in the past tense, A prayer for the afflicted, when he was in distress, and poured out his meditation, 134134 “Sa plainte.” — Fr. “His complaint.” seem to give an incorrect view of the mind of the prophet. He rather intended to relieve the sorrow of those whose hearts he saw depressed; as if he had said, Although you may be afflicted with anguish and despair, you must not on that account desist from prayer. Some translate the verb עטף, ataph, when he shall hide himself, and conceive that this is a metaphorical expression of the gesture of a man engaged in prayer, when, on account of his grief, unable to lift up his face, he, as it were, hides himself, and keeps his head wrapped up in his bosom. But there appears to me to be an elegant play upon the words, when the distresses of the mind, and its being shut up, are spoken of, on the one hand, and the pouring out of prayers on the other; teaching us that, when we are so shut up by grief as to shun the light and presence of men, the gate is so far from being shut against our prayers, that then in truth is the most proper season for engaging in prayer, for it is a singular alleviation of our sorrows when we have opportunity freely to pour out our hearts before God. The verb שוח, suach, often denotes to pray; but, as it also signifies to meditate, the noun derived from it properly means, in this place, meditation. It is, moreover, to be observed that, by these words, the Psalmist admonishes the Israelites as to the frame of mind with which it became them to use this form of prayer at the throne of grace; as if he had said, that he prescribed it to those only who were distressed on account of the desolate condition of the Church.