During the time when David was fleeing from Saul for his life, he had men, warriors, which joined him by the hundreds. He was always at risk that some infiltrator allied with Saul, the king, would join his ranks for the purpose of betraying him and ultimately ending his life disgracefully.
Here is the account from 1 Chronicles 12 of his address to a group of men wishing to join him.
16 And some of the men of Benjamin and Judah came to the stronghold to David. 17 David went out to meet them and said to them, "If you have come to me in friendship to help me, my heart will be knit to you; but if to betray me to my adversaries, although there is no wrong in my hands, then may the God of our fathers see and rebuke you." 18 Then the Spirit came upon Ama'sai, chief of the thirty, and he said, "We are yours, O David; and with you, O son of Jesse! Peace, peace to you, and peace to your helpers! For your God helps you." Then David received them, and made them officers of his troops.
One thing strikes me about this interaction.
Both David and the men who seek to join him as well as the narrator all appeal to the unseen presence of parties not immediately present. Particularly, David puts it to the men bluntly, you are here to help me or to harm me—but if you betray me, God will bring you justice.
David’s appeal to God who will bring justice to him, if it should be true these men are present to betray him is a faithful appeal to the God of justice, who only holds the power of making right the wrongs of a potential betrayal. It is not unlike other such assertions of the Hebrews, where someone wronged spoke out against his persecutor who is about to execute him, “Justice will be served to you for putting me to death undeservedly. I will rise from the dead and you will be judged by my God who will raise me back to life.”