After hearing Joshua conquered Jericho and Ai (v.1), Jabin is so scared, he asks 5 other kings to help him attack Israel (v.2-5). Since they numbered as many “as the sand of the sea” (v.4), this upcoming battle is a type of the battle of Gog and Magog (Rev.20:7-9). Gog and Magog are gathered “from the four quarters of the earth,” i.e., the four directions (IChr.9:24), just as Jabin gathered these armies from the four directions (Josh.14:1-3). That makes Jabin a type of Satan.
Of course, Gog and Magog come 1,000 years after Armageddon (Rev.19:11—20:9), and the battles in Joshua are types of the mop-up battles that will come before the millennium. But the type jumps over the millennium because nobody in the Old Testament knew the first 1,000 years of the kingdom would be different than the rest.
The Lord tells Joshua that “to morrow about this time” He would deliver those nations to Joshua (Josh.11:6), and Joshua beat them “suddenly” (v.7), staying true to the suddenness of the fire that will win the battle in Revelation 20:9.
Jabin’s kingdom is said to be the “head” of all the kingdoms (Josh.11:10) because Jabin is a type of Satan, and his kingdom is the head of all earth’s kingdoms (John 12:31).
Destroying “all that breathed” (Josh.11:11) also fits the type of what will happen at Gog and Magog. The cities that “stood still” (v.13) were those still standing after they conquered those cities. They burned the cities not still standing, but inherited the ones that were (Deut.6:10,11), including the “labour” it took to build those cities (Ps.105:42,45).
The “long time” Joshua warred with those nations (Josh.11: 18) describes all his battles, not just this sudden type of Gog and Magog. We know Joshua is looking back at all Joshua’s battles because he mentions the league with Gibeon (v.19).
Joshua 11:20 says God hardened the hearts of those kings to get them to attack Israel so He could wipe them out. That’s fair because of how He hardened their hearts. He got them to harden their own hearts, as He did with Pharaoh. He threatened to kill his son (Ex.4:21-23 cf. 8:15).
But the way God got these kings to harden their hearts was more like how He hardened Sihon’s heart. He had Moses tell Sihon that Israel wanted to pass “through” his land, but God hardened his heart so he wouldn’t let them (Deut.2:26-30), by speaking respectfully to him, promising him that Israel wouldn’t eat his crops, etc. (Num.21:21,22). That was truthfully their intention, but Sihon didn’t believe the truth (Judges 11:20,21). He figured it was a trick to get his land!
And that’s how God hardened the hearts of these kings—by telling them the truth—the truth that the land was His, and He was taking it! They didn’t want to believe that truth, so hardened their own hearts. That’s a type of how the Lord will sit on the throne of earth for 1,000 years telling the world He’s King of their kings, but they won’t want to hear it, so they’ll harden their hearts and fight God at Gog & Magog.
When Pharaoh and Sihon didn’t respond well to threats or respectful language, that’s reminiscent of how Israel didn’t respond well to John’s threats of judgment and the Lord’s loving ministry of healing (Mt.11:16-19). God always bends over backwards for people before judging them, so don’t feel sorry for the babies He ordered destroyed (ISam.15:3). That’s just God giving an eye-for-an-eye kind of justice, because that’s how His enemies treated Israel (Ps.137:8,9).
Joshua drove all the giants out of the land (Josh.11:21,22cf. Num.13:33), but there were some left in “Gath” (Josh.21:22 cf. I Sam. 17:4). The Jews did later wipe the giants out (IISam.21:16-22;Amos 2:9). The “rest” from war that followed this type of Gog and Magog is a type of the rest that will follow the actual battle (cf.Isa.2:2-4).