1 Samuel 6:3
And they said, If ye send away the ark of the God of Israel, send it not empty; but in any wise return him a trespass offering: then ye shall be healed, and it shall be known to you why his hand is not removed from you. And they said, If ye send away the ark of the God of Israel, send it not empty; but in any wise return him a trespass offering: then ye shall be healed, and it shall be known to you why his hand is not removed from you.
The counsel was given after disease and other judgments had followed the ark from city to city, bringing affliction upon the Philistines and their land. Their advisers, the priests, urged them not to send away the ark of Israel's God empty, but to accompany its return with a trespass offering. That trespass offering was to be costly. It took the form of golden representations of the plagues, following the customary practice of presenting images of afflicted body parts as offerings.
The advice recognized that the affliction had followed their taking of the ark that belonged to Israel, and the offering acknowledged Israel's God amid those afflictions. They promised that then the people would be healed. They promised also that then they would learn why his hand was not removed from them. The offering was meant to appease God's wrath and obtain relief, but it did not call the Philistines to abandon idolatry and serve God.