The Philistines’ triumph of capturing the Ark of the Covenant from the Israelites quickly turned to despair as their gods were destroyed and they experienced an outbreak of tumours and a plague of rats.
The Philistines’ own diviners told them the only solution was to return the Ark. Several hundred years after the Israelites left Egypt, the might of God still resonated with the other peoples in the region:
1 Samuel 6:6 Don’t be stubborn and rebellious as Pharaoh and the Egyptians were. By the time God was finished with them, they were eager to let Israel go.
This newly found fear of God didn’t become worship; it seems to have been more a case of avoidance. And after the Ark was returned, it didn’t stop the Philistines from attacking Israel some 20 years later. Although the Philistines lost that battle, later books in the Bible show they attacked again and again.