1 Samuel 6:1

And the ark of the LORD was in the country of the Philistines seven months.

The ark remained in Philistine territory for seven months after its capture. During all that time Israel made no attempt and no effort to recover it. The Philistines had desired it because they expected it to secure their safety and power. Instead calamity and divine judgments followed it from place to place wherever it went.

The judgments were severe, with disease striking Ashdod, Gath, and Ekron, while mice damaged food stores and crops and threatened the nation with disease or famine. Thus what they had desired became a burden and a curse to its captors, and they became eager and urgent to be rid of it and send it away. They came to recognize that God's hand was upon and against them because they had taken what belonged to Israel.

The ark itself was guarded from harm by angels. After what happened to Dagon the Philistines were afraid to approach it. They sought counsel from their priests and diviners about returning it, and were told to send it back with a costly trespass offering to appease God's wrath.