The ark is taken in battle: 4:1-11 For some 20 years, the Philistines have exerted pressure on the Israelites and other peoples of Canaan from their coastal lands. The battle that takes place at Aphek is critical, for it opens even more Israeli lands to the Philistines. Archaeological excavations show that eventually Philistine occupation forces even penetrated beyond the mountains of Palestine, to the Jordan plain.
The battle is fought in two phases. After an initial defeat, the Israelites send to Shiloh for the ark of God. This portable wooden chest, overlaid with gold, symbolized the very presence of God. It is supposed to stay in the tabernacle, but now is superstitiously brought to the battleground. In the second phase of the battle, Israel suffers a crushing defeat and the ark of God is capture.
2 And the Philistines put themselves in array against Israel: and when they joined  battle, Israel was smitten before the Philistines: and they slew of the army in the field about four thousand men. 3 And when the people were come into the camp, the elders of Israel said, Wherefore hath the Lord smitten us to day before the Philistines? Let us fetch  the ark of the covenant of the Lord out of Shiloh unto us, that, when it cometh among us, it may save us out of the hand of our enemies. 4 So the people sent to Shiloh, that they might bring from thence the ark of the covenant of the Lord of hosts, which dwelleth between the cherubims: and the two sons of Eli, Hophni and Phinehas, were there with the ark of the covenant of God.
Judgment on Eli’s house: 4:12-22. Eli’s two evil sons die in the battle. When Eli hears, he falls and breaks his neck. The death of this man, who has led Israel for 40 years, with the capture of the ark, completely demoralizes the Israelites and ends organized resistance to the Philistines.
… when he made mention of the ark of God, that he fell from off the seat backward by the side of the gate, and his neck brake, and he died: …
19 And his daughter in law, Phinehas’ wife, was with child, near to be delivered:  and when she heard the tidings that the ark of God was taken, and that her father in law and her husband were dead, she bowed herself and travailed; for her pains came upon her. 20 And about the time of her death the women that stood by her said unto her, Fear not; for thou hast born a son. But she answered not, neither did she regard it. 21 And she named the child Ichabod,  saying, The glory is departed from Israel: because the ark of God was taken, and because of her father in law and her husband. 22 And she said, The glory is departed from Israel: for the ark of God is taken.
Glory of God can dwell with us or depart from us. God can go to war with us or choose not to go with us. Due to the evil acts of Eli’s two sons, God had already pronounced His judgment against the Eli’s family through a prophet. Carrying the ark of God to the battle did not change that plan.