Because God fought for them, they killed many of the enemy. They dispossessed the Hagrites and lived in their land until the exile.
Now the Philistines fought against Israel. The Israelites fled before the Philistines and many of them fell dead on Mount Gilboa.