Why did the nation come to the camp?
Malbim: [The surviving soldiers returned to the camp] to fight again.
What do we learn from "Lamah Nigafnu"?
Malbim: They thought that they are Tzadikim. Really, they were evil idolaters; Pesel Michah was among them "Kol Yemei Heyos Beis Elokim b'Shilo" (Shoftim 18:31). This aroused Hashem's anger against them - "Hineni Nishpat Osach Al Amrecha Lo Chatasi" (Yirmeyah 2;35).
Why did they think that the Aron would save them?
Radak citing Targum Yonasan: Due to the honor of His name, we will be saved from our enemies.
Radak (4): This was Hashgachah, so Bnei Eli would come to the war [and die].
Malbim: They thought that Hashem will need to save His Aron from the Pelishtim, and also they will be saved. They erred. The Aron is not an end in itself, rather, in order to guard (observe) what is in it!