The Philistines were an immigrant people from the military aristocracy of the island of Crete (Amos 9:7). Small numbers of Philistines were in the land at the time of Abraham, but they only came in force soon after Israel came to Canaan from Egypt.
The Philistines’ period of greatest importance was from 1200-1000 BC when they were the principal enemies of Israel. They were organized into five city-states: Ashdod, Gaza, Ashkelon, Gath, and Ekron (Joshua 13:3; 1 Samuel 6:17). They were repulsed by the Egyptians in 1191, which forced their invasion of Canaan. Their cities were ruled by 5 lords or rulers (Joshua 13:3; Judges 16:5), one for each city.
The Philistines were a sea-faring people and traded with distant lands. Therefore, they were among the first in acquire newer and better military technology such as from the Greeks. Thus, the Philistines became a powerful enemy of the people of Israel.
The Philistines were the first in the region to effectively use iron. Before the influx of technology, the Israelites could compete on more equal terms with Moab and Ammon, but Greek military equipment (helmets, shields, coats of mail, swords and spears) made the Philistines much more formidable opponents. The Israelites did not yet know how to forge iron until the time of David. The Philistines did not share this technology, forcing the Israelites to come to them for iron.
During David’s time as a vassal of the Philistines, it is possible he learned the technique of iron-making. Probably David remained a Philistine vassal during the 7 1/2 years he reigned at Hebron (2 Samuel 1:1-4). When at the end of this time, he asserted his independence and united all of Israel under his rule, he defeated them in 2 battles (2 Samuel 5:17-25). David repeatedly bested them, ending their dominion over the Promised Land.