As David literally fled for his life from Saul, he paused in 2 peculiar and very different locations. First he went to the house of God. This did not bode well for the men of God who served as priests there. In fact, Ahimelech the priest was scared when David showed up at his door. (We will discover later that his fears were certainly justified). As David was truly a fugitive, he needed some very basic things. So, he was given some of the holy bread (Exodus 25:30 & 40:23) and the sword of Goliath - which obviously had been kept there as a relic to remind everyone of God's power and aide.
From there David went to see the Philistines. In fact, he went to Gath. Get this now: David, the one who had killed Goliath (of Gath), the one who was formerly Saul's armor-bearer, the one of whom the Jewish ladies sang, "David has slain his 10,000s", the one who killed 200 Philistines to use their foreskins as a dowry... why in the name of common sense would that same man have chosen to go to Achish in Gath; to the king of the Philistines? If nothing else, this shows us how desperate David felt. Of course, it didn’t take too long for him to realize that he was in the wrong place. He ended up pretending to be mentally ill to escape from the court of the Philistine king.
If you want a lesson from this chapter, look no further than the dangers that David faced. Realize that he was God's man in God's care and yet he was alone, afraid and (in his opinion) in grave danger.
Walking with God and working for Him does not in any way insure us an easy journey. Life abounds with difficulties. Even the life of God's chosen servants can be filled with hardships. In fact, many times the hard times come BECAUSE we are following Him. But, David had many blessings ahead of him. He just had to wait.