In 1 Samuel 27-31, we read of David's flight from Saul into Philistine territory. While in Philistine territory, David becomes a vassal of Achish, the King of Gath, and rules as the Prince of Ziklag, which thus becomes an inheritance of the Kingdom of Judah.
The Philistines appear to be a coalition of loosely affiliated city-states with city-dynasties. They collaborated in their war against Israel, but there was no permanent "high king." David had, of course, earlier delivered Israel from Goliath, who was a giant of Gath. Joshua 11 informs us that the Anakim (a tribe of nephilim) were eliminated from the land of Canaan at the time of the conquest, except for the remnant who remained in Gaza, Gath, and Ashdod. The reality is that despite Goliath's strategic utility in the Philistine war effort, he was almost certainly unpleasant to live with. We cannot make definite statements about what the residents of Gath experienced in his presence, but we can make educated guesses based on what we know from other scriptures. The giants are interrelated in a uniquely intimate way with the diabolic powers. And one of the persistent associations that is found cross-culturally is that they eat people. The idea that the devils want to eat you is rooted in Genesis 3, where the serpent is told that he will "eat dust"- the very dust to which, in context, man will return. Hence, satan is called a "roaring lion, seeking someone to devour" (1 Peter 5:8).
Sacrifice sets the table. The opposition in some contemporary theology between a "sacrificial" concept of the Eucharist and a "table centered" concept of the Eucharist is abject nonsense, in biblical and traditional terms. This is why the alternative, if you are living in Corinth or Rome, to eating meat that has been on idolatrous altars, is to eat only vegetables. A In cultures under especially intense diabolic oppression, human sacrifice becomes the norm. They want to devour your life and make it their own. The embodied presence of these giants suggests that there may have been a literal consumption that occurred, and in view of this cross-cultural feature of the giant-archetype, this appears to have been the case in Canaan. ;Hence in Numbers 13:32, we read that the spies report "this is a land which devours its inhabitants, and all the people we saw in it are of great height." These things are usually not believable to the modern mind, but they form part of the Scriptural history and are inescapable if we are to read the Bible for all it is worth.
All of this, therefore, must be taken into account when considering David's defeat of Goliath. Goliath was the champion of the Philistines, yes. He was a key pillar of their military strategy. But living with him as a resident or dealing with him as the king was almost certainly a horrific experience. Perhaps, then (the text does not give us enough reason to make a certain conclusion), we might read this as a subtextual deliverance of the Gittites as well as the Israelites. Achish is aware of who David is when he welcomes him to Gath and makes him his vassal in Ziklag. Achish himself is a striking character- he describes David as "blameless in my sight as an angel of God" (1 Samuel 29:9). Achish also swears in the Name of the LORD (1 Samuel 29:6-7). Peter Leithart points out that the city of Gath is absent from the prophetic condemnations of Philistine cities. It is possible that Achish was simply swearing by the name of the deity whom he knew David worshiped.
Yet the Philistines had beheld the supremacy of Israel's God multiple times. In 1 Samuel 4, the ark of the covenant brought the idol of Dagon crashing on its face before the presence of God. Achish may have been a genuine worshiper of the true God and a righteous gentile. One more detail suggests the plausibility of this interpretation- in 2 Samuel 15:18, we read that there were six hundred residents of Gath who had followed David all the way to Jerusalem and became, there, his allies and servants. Consider the immense difficulty, particularly in antiquity, of moving your entire life to another place. Yet six hundred men of Gath had enough affection for David to do so. If there were six hundred who had *this* much devotion to David, you can be sure that there were thousands more who loved David, but remained in Gath. After all, it was no sin to remain in Gath! Even twelve or fifteen Gittites who became part of David's company would be remarkable. Six hundred is extraordinary.