“For they cried to God in the battle, and he was intreated of them; because they put their trust in Him.”
One tribe cries out to the LORD and another was unfaithful to God and went a whoring after the gods of the land and were taken away captive.
Indeed God is faithful to bless those who walk in obedience to His laws. In Deuteronomy 28 He carefully laid out to the people of God the blessings bestowed on those who walk in obedience and the curses which befall those who walk contrary to His law.