Kenneth A. Kitchen argues that "Philistine" in Genesis 21 and 26 is an example of an anachronism introduced by a later editor updating the text replacing a then-obsolete term.
Kenneth A. Kitchen, On the Reliability of the Old Testament (Grand Rapids, MI: Eerdmans, 2003), 339-41
The charge of “anachronism” is also frequently leveled at the appellation “ Philistine” found in Gen. 21:32,34 (of the land), and in Gen. 26 (of Abimelek of Gerar and his subjects). If, as is clear, the patriarchs and therefore their contemporaries lived in the first half of the second millennium, before circa 1550, then it is no surprise that commentators find difficulty with the term “ Philistine” in Genesis, seeing that this name for a people group occurs only from Year 8 of Ramesses III (ca. 1180 or 1177), among his Sea People opponents. It is absent from the alliance of Sea Peoples and Libyans that had earlier attacked Egypt in the fifth year of Merenptah in 1209. So it is fatally easy to scream “anachronism" at this term in the patriarchal narratives.
In Gen. 21 the sole usage with Abraham is in the phrase “the land of the Philistines” (w.32, 34), and this would fall into the same category as the phrases "the route of (= to) the land of the Philistines” (= the north Sinai Mediterranean coast road) in Exod. 13:17 and the bounds “from the Sea of Reeds to the Sea of the Philistines” (= Mediterranean) in Exod. 23:31, Likewise in Josh. 13:2,3. Here we see a usage from the twelfth to tenth centuries (1180 and following) that replaced an earlier, obsolete term — just as we would say “the Dutch founded New York” although they did so as New Amsterdam, the present name replacing the former under their British successors. And nobody ceaselessly squawks “anachronism” about this! Compare already the tacit later substitution of Dan for Laish in Gen. 14:14. Thus some earlier and obsolete term would have been replaced in such cases. Some traces of this still survive in the Hebrew text. Thus Josh. 13:3 lists the five cities of the Philistines, “reckoned as Canaanite,” and brings in the obscure Avvim. In 1 Sam. 30:14 “the Negev of the Kerethites” (perhaps “Cretans”) is named close to Philistia, “ Kerethites” being a term used as an archaism for Philistia by the later prophets Zephaniah (2:5) and Ezekiel (25:16). David’s Kerethites had the same origin (2 Sam. 15:18 and elsewhere). In the case of Isaac (Gen. 26:1, 8), he went to Abimelek, “king of the Philistines, to Gerar,” and Abimelek, so titled, viewed Isaac and Rebecca. In Gen. 26:14-15, 18 the term is also applied to Abimelek’s subjects. One may go further back than Kerethites. In Deut. 2:23 it was noted that “the Caphtorians that came from Caphtor” replaced the luckless Awim. Again, in archaistic mood, the later prophets used this term — the Philistines were from Caphtor (Amos 9:7), and occur in parallel with Caphtor in [er. 47:4. All this archaic usage is exactly like the ancient phrases “sons of Sheth” for Moab and “tents of Kushan” for Edom/Midian (Num. 24:16; Hab. 3:7), in which Sheth is ancient Shutu and Kushan is antique Kushu from the early second millennium. Caphtor is ancient Kaptara, well attested from the early second millennium, when the Mari archives actually mention a king of Hazor sending gifts to Kaptara (Caphtor). Egyptian Keft(i)u (originally Kaftur) is simply a local variant of Kaptara; it is solidly attested from the sixteenth century to the thirteenth, and may be traced back to the Twelfth Dynasty (ca. 1973-1795) and before.
At this point questions need to be asked that are never asked, and which need answering. Why does the biblical narrator locate his “ Philistine” king at Gerar and not in the pentapolis cities, e.g., in Gath or Gaza? Why is there no Philistine army force to deal with the unwanted Hebrew pastoralists? Why introduce a “ Philistine” element at all? (The stories would read just as well with Canaanite characters, as at Shechem!) Is it not because these are in fact merely “modernized" Caphtorians, with a different profile to the later “ historic" Philistines? If so, then we simply have Abraham and Isaac dealing with another non-Canaanite element in the land (like the sons of Heth, or the Horites/Hurrians). But in this case, coming from and/or linked with the Aegean area.
Does that suggestion make sense in the early second millennium? The Mari report of sending tin to kings of Laish and Hazor (in Canaan) and to Kaptara (Crete) suggests that the traffic was not all one way. And indeed, it was not. In Middle Bronze Hazor itself, Middle Minoan II pottery duly turned up — maybe part of some reciprocal deal.5’1’ Up north in Alalakh (level VII, ca. eighteenth (seventeenth century) on the lower Orontes, the sprawling palace of its local kings had frescoes executed in Cretan style and technique.97 In Canaan itself (in western Galilee), Tel Kabri was found to have a Middle Bronze II palace (late seventeenth century) that; also contained plastered walls and floors painted with Cretan-style frescoes,98 And work on sixteenth-century Avaris in the Egyptian East Delta has also revealed spectacular remains of Minoan paintings.99 Cypriot pottery also occurs in sites in Canaan during our period, as at Megiddo in the north, and at southwest sites such as Tell Abu Hureirah/Tel Haror (probably Gerar), and Tell lemmeh in the south. The Middle Bronze temple at Tel Haror yielded also a chalice with “ Minoan-type tall handles”
Thus it is conceivable that Abimelek and his retainers (especially Phicol) may also once have been Kaphtorians or even Kerethites, before “ Philistines” later became a blanket term for non-Canaanite, Aegean people in that part of southwest Canaan.