Why was Yisrael defeated initially?
Rashi (Bereishis 19:8, from Sanhedrin 103b): Yisrael did not protest similarly against Pesel Michah (Ramban 19:8 - for which people were Chayav Misah and rebelled against Hashem, but they protested more than is proper due to the honor of people). Radak - they should have eradicated Pesel Michah, just like they eradicated [the doers of] this evil.
Ramban (Bereishis 19:8): It was improper to make war. It was upon Binyamin to fence the matter. A Shevet is commanded to judge itself. They did not ask Hashem whether it is proper to fight, nor whether they will win. They relied on human strength; they were much more numerous. Hashem left both Yisrael and Binyamin to 'chance'. Binyamin were mighty, and their cities were fortified.