The Philistines had a long-standing dislike for Judah. Their specific wrongdoings are not mentioned, but the Lord noticed them and would seek revenge. They would then understand the Lord's supreme power.
The Kerethites were a Philistine tribe (see 1 Samuel 30:14).