Psalms 140 to 143 form a distinct group because of their many similarities. They are all psalms of David when he was under difficult circumstances and internal persecution by a strong foe, but he turns to the Lord for protection and deliverance. Just as Satan schemes to cause God's people to stumble in their walk of faith, so it was with David's enemies as we see in Psalm 140. It was mainly because of his righteousness, inner peace, and high standards that they gathered together to wage war against him in an organized and premeditated campaign. The plotted against him, slandered, and set traps that he might fall. He prayed that God would deliver, preserve, and keep him from these violent men who sought his destruction.
When Satan and his co-workers attack us, we, like David, can be confident that God will protect us where we are most vulnerable. Like the strongest helmet, God protected David's head when the battle raged against him. As for the heads of the wicked, David prayed that their own evil would fall upon them (140:9; 141:10). If they were the victors it would reflect badly on the cause of righteousness. Therefore, for the Lord's sake, David prayed that He bring just retribution so they will not be exalted, but rather overthrown. David ends the psalm with confidence, for unlike the wicked who are cast out, he and other upright people will be defended by God and will live to thank Him since they shall have the greatest privilege — to dwell in God's presence.
In Psalm 141, David is in a similar circumstance as in the previous psalm, but here he is more concerned that in his suffering he not succumb to temptation. For this he asks for God's help and for reproof and correction from the righteous. He asks that his prayer and his supplication with uplifted hands be as acceptable to God and as effective as the evening offering of incense and sacrifice in the House of the Lord.
The evildoers were seeking David's downfall by tempting him to do evil like themselves, and to join in with their wicked pleasures, but David asks the Lord for strength to guard his mouth and heart from doing evil and participating in worldly pleasure and luxuries. Often the enemy attacks under the guise of friendliness which can be more effective than direct assaults. David recognizes the dangers of compromise and so he prays that he would always welcome the rebukes of the righteous if he ever starts to go off course. A loving reproof is a great kindness to a fellow believer, so he will not yield to temptation and fall into sin. It is like a soothing and pleasant oil upon one's head that is beneficial and for the receiver's own good. It is also a means whereby God helps His children to "escape safely" from the snares and traps of the workers of iniquity (141:10).
As we learn from the title of Psalm 142, it is a prayer of David "when he was in the cave". This likely refers to the time when he was in the cave of Adullam after fleeing from the Philistines in Gath (1 Sam. 22:1). From David's plea we can see that he had reached the depths of loneliness and despair. He cried out to God, pouring out his complaints and declaring his trouble. He may have been alone, but if his young companions were still with him (1 Sam. 21:2), he nonetheless felt alone and forsaken. God was his only Refuge. He found no refuge in Gath (1 Sam. 21:10-15). Without God, even hiding in the cave could give him no protection. God was his only portion or inheritance, for Saul had forced him to flee from his home and had likely confiscated the land of his inheritance.
David, however, had a great source of strength — his faith in God. The many snares that his strong enemies had laid against him would not prevail (142:3b; 141:9,10; 140:5). He felt secure in the Lord. God would never let him fall prey to his hunters. He felt imprisoned in the cave since Saul had taken away his freedom, yet he was confident that God would bless him abundantly and surround him with the righteous for which he would give glory to God. As history records, God did indeed surround David with many others to support and strengthen him. While hiding in that very cave, God sent four hundred men (1 Sam. 22:2) to him.