The passage doesn’t specifically say this, but it would seem that, following God’s affliction on the people of Ashdod, Gath, and Ekron, no other towns would take the ark, and so the Philistines bundled it into the countryside to get it out of the cities, and as a result the Lord chose a plague of rats or mice to destroy the harvest, and reduced the area to famine. This went on for seven months, which was long enough to make the Philistines regret ever having taken it from the Israelites.
Man is a worshipping creature. Although his heart is darkened by sin, there remains enough light within for him to know that he is under the hand of God, that often God punishes him for his evil, and that he cannot fight against God but must avoid further provocation by confessing his sins and acknowledging that God is just in treating him as he has. This sense of God does not however give him sufficient light to worship God as he should, but produces all manner of vain superstitions in him. Although there is much ignorance in pagan religion, it is driven by a powerful sense of guilt for sin, and punishment due. But men never rise to a true understanding of how to approach God, but make up their own rites and ceremonies which can never give them any real relief.
The Lange commentary makes much of the beauty of the language, particularly in the original, and the construction of words. The priests of the Philistines can pronounce things with great beauty of language, but it doesn't alter the fact that they are utter hypocrites and they do not mean a solitary word of it, and they have no intention whatever of repenting before God. We should never forget that hypocrites can say some very beautifully things.