At that time, the Philistines gathered for an attack on Israel. Israel went out to engage them in battle and camped at Ebenezer, while the Philistines camped at Aphek.