The Philistines had captured the ark of God. They took it from Ebenezer to Ashdod.
References for 1 Samuel 5:1
They carried the ark into the temple of their god Dagon. They set it down beside the statue of Dagon.
The people of Ashdod got up early the next day. They saw the statue of Dagon. There it was, lying on the ground! It had fallen on its face in front of the ark of the Lord. So they picked the statue of Dagon up. They put it back in its place.
But the following morning when they got up, they saw the statue of Dagon. There it was, lying on the ground again! It had fallen on its face in front of the ark of the Lord. Its head and hands had been broken off. Only the body of the statue was left. Its head and hands were lying in the doorway of the temple.
That's why to this very day no one steps on the bottom part of the doorway of Dagon's temple at Ashdod. Not even the priests of Dagon step there.
The LORD's powerful hand punished the people of Ashdod and the settlements that were near it. He destroyed them. He made them suffer with growths in their bodies.
The people of Ashdod saw what was happening. They said, "The ark of the god of Israel must not stay here with us. His powerful hand is punishing us and our god Dagon."
So they called all of the rulers of the Philistines together. They asked them, "What should we do with the ark of the god of Israel?" The rulers answered, "Have the ark moved to Gath." So they moved it.
But after the people of Ashdod had moved the ark, the LORD's hand punished Gath. That threw its people into a great panic. The LORD made them break out with growths in their bodies. It happened to young people and old people alike.
So the ark of God was sent to Ekron. As the ark was entering Ekron, the people of the city cried out. They shouted, "They've brought the ark of the god of Israel to us. They want to kill us and our people."
So they called all of the rulers of the Philistines together. They said, "Send the ark of the god of Israel away. Let it go back to its own place. If you don't, it will kill us and our people." The death of so many people had filled the city with panic. God's powerful hand was punishing the city.
Those who didn't die suffered with growths in their bodies. The people of Ekron cried out to heaven for help.