Israel was led out Egypt/slavery and the Lord promised to fight for them against their enemies (Deut. 20:4). This is always true, even when Israel becomes its own enemy. The Lord will fight against Israel when she is an enemy of Israel/enemy of the descendents of Abraham/promise. This happens when Israel becomes wicked and does not follow the Lord’s commandments. The Lord will fight against wicked Israel because she has become a type of Egypt, and she too will receive the plagues/curses of Egypt (Deut. 28:58-61).
The Lord will diminish the numbers of wicked Israel (“And ye [Israel] shall be left few in number,” Deut. 28:62), therefore, ensuring that obedient Israel will always remain “too mighty”; obedient Israel will remain numerous, like the stars – she remains that way because she serves the Lord who led her out of Egypt, the Lord who goes with her, the Lord who fights against her enemies.