You can read the incident that this is a reference to, in I Samuel chapters 4 – 6.
The Philistines were a culturally Aegean/Mycenaean people who had settled along the coast of Canaan. Though culturally Greek, they spoke a Semitic language. Their god, Dagon, was a man/fish god who had antecedents going all the way back to Sumeria.
The genre of these particular chapters of Scripture might be described as dark comedy. It’s a unique story, because it presents the reaction of an Aegean people when confronted with the God of Israel. The story is told in a Hebrew historical record, but the amount of detail means that the Hebrew chronicler must have had spies or eyewitness accounts.
The Philistines, though, or perhaps because, they are pagans, are pretty canny. They start out thinking they have won a victory over the Israelites by capturing their god, but it doesn’t take them too long to figure out that this God is trouble, and to ascertain, by process of elimination, what He wants.
Or you could say that God is very adept at communicating with the Philistines.