The title of this psalm and many others is as a key hung ready at the door, to open it, and let us into the entertainments of it; when we know upon what occasion a psalm was penned we know the better how to expound it. This was composed, or at least the substance of it was meditated and digested in David's thought, and offered up to God, when he fled from Absalom his son, who formed a conspiracy against him, to take away, not his crown only, but his life; we have the story, 2 Sam. xv., &c. 1. David was now in great grief; when, in his flight, he went up the Mount of Olives, he wept greatly, with his head covered, and marching bare-foot; yet then he composed this comfortable psalm. He wept and prayed, wept and sung, wept and believed; this was sowing in tears. Is any afflicted? Let him pray; nay, let him sing psalms, let him sing this psalm. Is any afflicted with undutiful disobedient children? David was; and yet that did not hinder his joy in God, nor put him out of tune for holy songs. 2. He was now in great danger; the plot against him was laid deep, the party that sought his ruin was very formidable, and his own son at the head of them, so that his affairs seemed to be at the last extremity; yet then he kept hold of his interest in God and improved that. Perils and frights should drive us to God, not drive us from him. 3. He had now a great deal of provocation given him by those from whom he had reason to expect better things, from his son, whom he had been indulgent of, from his subjects, whom he had been so great a blessing to; this he could not but resent, and it was enough to break in upon any man's temper; yet he was so far from any indecent expressions of passion and indignation that he had calmness enough for those acts of devotion which require the greatest fixedness and freedom of thought. The sedateness of his mind was evinced by the Spirit's coming upon him; for the Spirit chooses to move upon the still waters. Let no unkindness, no, not of a child or a friend, ever be laid so much to heart as to disfit us for communion with God. 4. He was now suffering for his sin in the matter of Uriah; this was the evil which, for that sin, God threatened to raise up against him out of his own house (2 Sam. xii. 11), which, no doubt, he observed, and took occasion thence to renew his repentance for it. Yet he did not therefore cast away his confidence in the divine power and goodness, nor despair of succour. Even our sorrow for sin must not hinder either our joy in God or our hope in God. 5. He seemed cowardly in fleeing from Absalom, and quitting his royal city, before he had had one struggle for it; and yet, by this psalm, it appears he was full of true courage arising from his faith in God. True Christian fortitude consists more in a gracious security and serenity of mind, in patiently bearing and patiently waiting, than in daring enterprises with sword in hand.