*Minor differences ignored. Grouped by changes, with first version listed as example.
And Joshua discomfited Amalek. The copula is here used instead of the illative particle; for Moses here concludes that the Israelites overcame their enemies, because he had continually persevered in prayer. There is, too, an implied antithesis between the firmness of his hands and the weakness of the enemy, that we may know that they were discomfited or conquered, not so much by the sword as by the uplifting of the rod, and by the intercession of the holy man.
With the edge of the sword - This expression always denotes a great slaughter of the enemy.
Joshua discomfited Amalek and his people - Amalek might have been the name of the ruler of this people continued down from their ancestor, (see Clarke on Exodus 17:8 (note)), as Pharaoh was the name of all succeeding kings in Egypt. If this were the case, then Amalek and his people mean the prince and the army that fought under him. But if Amalek stand here for the Amalekites, then his people must mean the confederates he had employed on this occasion.
And Joshua discomfited Amalek and his people with the edge of the sword. Amalek being distinguished from "his people", has led some to think that Amalek was the name of the king, or general of the army, and that it was a common name to the kings of that nation, as Pharaoh was to the kings of Egypt; but for this there is no foundation in the Scriptures: as Amelek signifies the Amalekites, his people may design the confederates and auxiliaries, the other people, as Ben Gersom expresses it, they brought with them to fight against Israel. And so Jerom (z) says, by him another Canaanite dwelt, who also fought against Israel in the wilderness, of whom it is so written, and Amalek and the Canaanite dwelt in the valley, Numbers 14:25 and who were all, the one as the other, at least the greatest part of them, cut to pieces by the edge of the sword of Joshua and the Israelites, who obtained a complete victory over them; as the spiritual Israel of God will at last over all their spiritual enemies, sin, Satan, the world, and death.
(z) Ut supra. (De Locis Hebr. fol. 87. M.)
Joshua discomfited Amalek--Victory at length decided in favor of Israel, and the glory of the victory, by an act of national piety, was ascribed to God (compare 1-John 5:4).
Though God gave the victory, yet it is said Joshua discomfited Amalek, because Joshua was a type of Christ, and of the same name, and in him it is that we are more than conquerors.
*More commentary available at chapter level.