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. 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. And when the ark of the covenant of the Lord came into the camp, all Israel shouted with a great shout, so that the earth rang again… And the Philistines fought, and Israel was smitten, and they fled every man into his tent: and there was a very great slaughter; for there fell of Israel thirty thousand footmen… And the ark of God was taken; and the two sons of Eli, Hophni and Phinehas, were slain.
I Sam. 4:3-5, 10, 11 KJB
The people of Israel rallied around the Ark of the Covenant, believing that God was with them in their fight against the Philistines. However, they were presumptuous.
They followed God with their mouths, but not with their hearts.
Immorality had crept into their hearts and was reflected in their religious leaders who were either blind like Eli (1 Sam 4:14), or immoral and stealing from the people like Hophni and Phinehas (1 Sam 2:12-17,22).