Then the men of Kirjath Jearim came and took the ark of the Lord, and brought it into the house of Abinadab on the hill, and consecrated Eleazar his son to keep the ark of the Lord.
So it was that the ark remained in Kirjath Jearim a long time; it was there twenty years. And all the house of Israel lamented after the Lord.
Then Samuel spoke to all the house of Israel, saying, "If you return to the Lord with all your hearts, then put away the foreign gods and the Ashtoreths from among you, and prepare your hearts for the Lord, and serve Him only; and He will deliver you from the hand of the Philistines."
References for 1 Samuel 7:3
So the children of Israel put away the Baals and the Ashtoreths, and served the Lord only.
References for 1 Samuel 7:4
And Samuel said, "Gather all Israel to Mizpah, and I will pray to the Lord for you."
So they gathered together at Mizpah, drew water, and poured it out before the Lord. And they fasted that day, and said there, "We have sinned against the Lord." And Samuel judged the children of Israel at Mizpah.
Now when the Philistines heard that the children of Israel had gathered together at Mizpah, the lords of the Philistines went up against Israel. And when the children of Israel heard of it, they were afraid of the Philistines.
So the children of Israel said to Samuel, "Do not cease to cry out to the Lord our God for us, that He may save us from the hand of the Philistines."
And Samuel took a suckling lamb and offered it as a whole burnt offering to the Lord. Then Samuel cried out to the Lord for Israel, and the Lord answered him.
Now as Samuel was offering up the burnt offering, the Philistines drew near to battle against Israel. But the Lord thundered with a loud thunder upon the Philistines that day, and so confused them that they were overcome before Israel.
And the men of Israel went out of Mizpah and pursued the Philistines, and drove them back as far as below Beth Car.
Then Samuel took a stone and set it up between Mizpah and Shen, and called its name Ebenezer, saying, "Thus far the Lord has helped us."
References for 1 Samuel 7:12
So the Philistines were subdued, and they did not come anymore into the territory of Israel. And the hand of the Lord was against the Philistines all the days of Samuel.
Then the cities which the Philistines had taken from Israel were restored to Israel, from Ekron to Gath; and Israel recovered its territory from the hands of the Philistines. Also there was peace between Israel and the Amorites.
And Samuel judged Israel all the days of his life.
He went from year to year on a circuit to Bethel, Gilgal, and Mizpah, and judged Israel in all those places.
But he always returned to Ramah, for his home was there. There he judged Israel, and there he built an altar to the Lord.