After saying his heart-breaking goodbyes to Johnathon, David goes to a place called Nob, Isaiah 10:28 / Isaiah 10:32 / Nehemiah 11:32. There were eighty-five priests who lived at Nob, serving the tabernacle which had been set up there following the Philistine’s destruction of Shiloh.
Although Ahimelek the priest trembled when he met David, and asked why he was alone, David goes on to say he’s on a secret mission and ask for some bread. Ahimelek tells David he has no ordinary bread, and the only bread he did have was consecrated bread which was used for sacred things and only to be eaten by the priests, Exodus 25:30 / Exodus 35:13 / Leviticus 24:9.
This is a reference to the Showbread, or the bread of the Presence as prescribed in the Mosaic Law, Exodus 24:5-9. The bread was a featured provision of the tabernacle and was replaced each week with hot bread. It was holy from the fact of its being used in the tabernacle and only the priests were qualified to eat it.
However, Ahimelech was willing to allow David and his men to eat the bread if they had kept themselves from women, Leviticus 15:18, and so by permitting David to eat the bread, it’s clear that Ahimelech understood what the law was really about.
Jesus refers to this event in Matthew 12:3-4 / Mark 2:23-28, Jewish tradition regarding the Sabbath Day prohibited all activity, including plucking grain to eat, but Jesus and His followers ignored these cherished doctrines.
When the Jewish officials criticised the disciples, Jesus defended their actions by noting His opponents’ inconsistency, they justified David when he broke God’s law, Leviticus 24:5-9, but they condemned Jesus when He merely violated men’s traditions.
Then He explained that God had intended for the Sabbath command to provide relief for man, not be an additional burden. Finally, Jesus proclaimed His authority over the Sabbath saying that He Himself was Lord of the Sabbath. If Jesus created the Sabbath, surely, He knew what activities violated it.
The Sabbath was supposed to be a day of blessings and relaxation, free from work but the Jews had turned into a bunch of rules which consisted of dos and don’ts, and with over 613 laws, they always found a way around them.
Doeg, the Edomite was one of Saul’s servants and Ahimelech’s action toward David would eventually lead to his death by Doeg, whom Saul later commanded to kill him, 1 Samuel 22:11-23. David’s recognition of him meant that David was required to get out of Nob as quickly as possible because he knew that Doeg would certainly have notified Saul of David’s presence there.
David needed a weapon and the only one he wanted was Goliath’s sword, the very the sword with which he defeated Goliath, 1 Samuel 17:51-54.
Achish, the king of Gath, which was a Philistine city and all those who lived in Achish were well aware of David and his many victories. The servants of Achish recognised David and assumed that he was king of Israel on the basis of that song sung by the women of Israel, 1 Samuel 18:7.
As a result of knowing who he was, they were all afraid, they were afraid that David would do to them what he had done to so many others. Psalm 34, Psalms 52 and Psalm 56 are written based upon what happens here.
Although the servants of Achish and the king himself, were afraid of David, it appears that David was afraid of them and pretends to be insane.
This was a wise move because now wasn’t the time to get into another battle, and more importantly he was able to continue to hide from Saul, whilst staying in this Philistine city for protection. This would be the last place Saul would go looking for David.
"No temptation has seized you except what is common to man. And God is faithful; he will not let you be tempted beyond what you can bear. But when you are tempted, he will also provide a way out so that you can stand up under it."