David was chased back to his land by Achis. He is back in the land where he will be chased by Saul. He escapes all his persecutors by hiding in the cave of Adullam. In the list of heroes of faith and acts of faith in Hebrews 11, the way David goes and the place where he abides are recorded as proofs of faith (Heb 11:3838([men] of whom the world was not worthy), wandering in deserts and mountains and caves and holes in the ground.). Also now, knowing that he was destined by the LORD and anointed to be king, he has no intention of ascending the throne by force. It seems as if everything is over for him. He can do nothing and go nowhere.
It is like with the apostle Paul. When he is in prison, his service seems to be over. But just in prison he writes some special letters that we now have in the Bible: the letter to the Ephesians, the letter to the Colossians and the letter to the Philippians. David has written in the cave some of the psalms we have in the Bible (Psalms 57:142). In it we hear his mood “when he was in the cave” (Psa 142:11Maskil of David, when he was in the cave. A Prayer.
I cry aloud with my voice to the LORD;
I make supplication with my voice to the LORD.
). At the end of Psalm 142 he says: “The righteous will surround me” (Psa 142:77“Bring my soul out of prison,
So that I may give thanks to Your name;
The righteous will surround me,
For You will deal bountifully with me.”). We see that happening here.
When he is alone in the cave and pours out his soul before the LORD about his loneliness (Psa 142:44Look to the right and see;
For there is no one who regards me;
There is no escape for me;
No one cares for my soul.
), we see here how hearts and legs move for him. People come to him. They later become the heroes of David who help him to become his kingdom and share in his glory. But here they are not yet. David is here a picture of the Lord Jesus to Whom all who also have no part on earth come.
First his brothers and his whole family come to him. They are also in danger of being persecuted by Saul. Then come everyone who was in distress, and everyone who was in debt, and everyone who was discontented. They either have a personal need, a problem they cannot solve themselves, or someone who is on their heels to enslave them, or they are so bitter by injustice or incomprehension suffered that they have no choice but to go to David. They do that because they have nothing to lose. He is joined by about four hundred men.
So today, too, people come to the Lord who see in Him their last chance of survival (cf. Mk 5:25-2825A woman who had had a hemorrhage for twelve years,26and had endured much at the hands of many physicians, and had spent all that she had and was not helped at all, but rather had grown worse—27after hearing about Jesus, she came up in the crowd behind [Him] and touched His cloak.28For she thought, “If I just touch His garments, I will get well.”). They develop into heroes. This development takes place in the school of God, there one is formed. David is their superior, it is also his school. Being with David means not only faith in his cause, but faith in himself. It also means that you no longer belong anywhere else.
So it is with the believer who has taken refuge in the Lord Jesus. He only does this when his need is so great, that he sees no other way out when he is a debtor with a debt he cannot pay or is so bitter that life no longer makes any sense to him.