1 Samuel 4:1

And the word of Samuel came to all Israel. Now Israel went out against the Philistines to battle, and pitched beside Eben-ezer: and the Philistines pitched in Aphek.

The verse marks the events that followed after Samuel had been called to serve as God's prophet. Israel camped at Ebenezer beside Eben-ezer for battle against the Philistines, while the Philistines camped at Aphek, the field where Israel was defeated, the priests were slain, and the ark of God was taken twenty years before the later victory. The Philistines were again gathering their forces for war, and Israel went out to this battle rashly, without asking counsel from the Lord and without the approval or concurrence of the high priest Eli or the prophet Samuel, and the hand of God was not with Israel in the engagement.

In the first defeat Israel was overcome with four thousand men killed. The defeat made the Hebrews afraid that other nations hearing of it would be encouraged to make war with them. When the disheartened people returned to their tents, the elders of Israel asked why the Lord had smitten them that day before the Philistines.

The elders wrongly decided the defeat was because the ark of God was not with them, and sent to Shiloh for the ark of the covenant, recalling earlier victories when it was present such as the passage over Jordan and the easy conquest of Jericho, and thinking that merely having the ark with them would ensure victory and triumph. Israel's strength depended instead on obedience to God's law contained in the ark, which was a representative of God himself. The ark was carried to the camp by Hophni and Phinehas, sinful and polluted priests who were themselves transgressing that law.

When the ark came the confidence of the men of war was restored and all Israel shouted so that the earth rang, and the Philistines, understanding the ark had come and fearing the gods that smote the Egyptians, resolved to fight like men rather than become servants to the Hebrews. Renewed confidence in the ark did not prevent defeat: Israel was smitten and fled every man to his tent in very great slaughter with thirty thousand footmen fallen, the ark of God was taken, and the two sons of Eli, Hophni and Phinehas, were slain. The defeat exposed the nation's sin, yet Israel failed to recognize that sin as the cause of the disaster; though the nation was ripe for the judgments of God, they were so blinded by unbelief and rebellion that they could not see in their disaster a token of the Lord's displeasure.