A painful betrayal by trusted individuals and a last-minute rescue form the backdrop of this psalm, which serves as a prayer and an expression of thanks to God for His constant miracles [מאירי, ביאור שטיינזלץ]. The shock of being betrayed and reported to the authorities plunged David into deep sadness. To overcome this sorrow and restore his divine inspiration, he had to play musical instruments, setting the stage for his song [אלשיך].
The primary approach among commentators is that these betrayers were the residents of Ziph, a city located on the border of the territory of the tribe of Judah. Taking a different approach, another perspective suggests their name actually reflects their deceptive character, describing them as frauds who falsified their words [תורה תמימה]. These people went directly to King Saul to reveal David's secret hiding place [מצודת דוד].
The message the informants delivered to the king revealed a deeply cunning strategy. Rather than simply stating that David was in their territory, they emphasized that they were hiding alongside him as partners. They explained to King Saul that they had feigned hatred for the king, pretending to be David's allies. This elaborate act of friendship was designed purely to gain David's complete trust before handing him over to his enemies [חומת אנך].