David came to Nob to the priest Ahimelech. Ahimelech came trembling to meet David, and said to him, "Why are you alone, and no one with you?"
References for 1 Samuel 21:1
David said to the priest Ahimelech, "The king has charged me with a matter, and said to me, "No one must know anything of the matter about which I send you, and with which I have charged you.' I have made an appointment with the young men for such and such a place.
References for 1 Samuel 21:2
Now then, what have you at hand? Give me five loaves of bread, or whatever is here."
The priest answered David, "I have no ordinary bread at hand, only holy bread—provided that the young men have kept themselves from women."
David answered the priest, "Indeed women have been kept from us as always when I go on an expedition; the vessels of the young men are holy even when it is a common journey; how much more today will their vessels be holy?"
So the priest gave him the holy bread; for there was no bread there except the bread of the Presence, which is removed from before the Lord, to be replaced by hot bread on the day it is taken away.
Now a certain man of the servants of Saul was there that day, detained before the Lord; his name was Doeg the Edomite, the chief of Saul's shepherds.
David said to Ahimelech, "Is there no spear or sword here with you? I did not bring my sword or my weapons with me, because the king's business required haste."
The priest said, "The sword of Goliath the Philistine, whom you killed in the valley of Elah, is here wrapped in a cloth behind the ephod; if you will take that, take it, for there is none here except that one." David said, "There is none like it; give it to me."
David rose and fled that day from Saul; he went to King Achish of Gath.
The servants of Achish said to him, "Is this not David the king of the land? Did they not sing to one another of him in dances, "Saul has killed his thousands, and David his ten thousands'?"
David took these words to heart and was very much afraid of King Achish of Gath.
So he changed his behavior before them; he pretended to be mad when in their presence. He scratched marks on the doors of the gate, and let his spittle run down his beard.
References for 1 Samuel 21:13
Achish said to his servants, "Look, you see the man is mad; why then have you brought him to me?
Do I lack madmen, that you have brought this fellow to play the madman in my presence? Shall this fellow come into my house?"