Here is a time line of suffering from 1Samuel 21-24:
1 David leaves the service of Saul with only the clothes
on his back, a few close friends, but not his best friend.
2 David stops to pick up bread from the priest at Nob on
his way to Gath of the Philistines.
3 David escapes from Gath and goes to Adullum. His
family comes to him there as well as "everyone in
debt, distress, or in bitterness of soul,"about 6,000 men.
4 David goes to Mizpeh of Moab and asks the king to
take care of his parents. Later he would write: "For
my father and mother have forsaken me, but the Lord
will take me in." Ps 27:10
5 King Saul kills the priest, his family and all the men,
women and children--even animals--at Nob. All
because of bread! One son escapes and joins David.
6 The prophet Gad sends David to Judah for a purpose.
7 The purpose: David saves a town from death but the
people plan to give David over to Saul. Betrayal.
8 David moves to the hill country of the wilderness of Ziph.
The Ziphites betray David to Saul.
9 David flees to the wilderness of Moan. He is discovered.
10 David flees to the wilderness of Engedi.
Dear reader, if any of these events strike a cord in you, then
the psalms David wrote are your psalms also.