Israel encamped at Ebenezer and the Philistines encamped at Aphek for battle, and Israel was defeated, losing 4000 men. So they brought the ark of the covenant to the camp with Hophni and Phinehas. They shouted, scaring then steeling the Philistines, and lost greatly, losing 30,000 men. (1 Samuel 4)
Samuel erected the stone Ebenezer between Mizpah and Shen after Philistia's attack on Mizpah during his prayer and sacrifice for Israel to turn away from the Ashtaroth and Baals and to God only. Israel's cities were restored, and they had peace with Philistia. (1 Samuel 7)