Bamidbar / Numbers 31:2 · Drash
נְקֹם נִקְמַת בְּנֵי יִשְׂרָאֵל מֵאֵת הַמִּדְיָנִים אַחַר תֵּאָסֵף אֶל־עַמֶּיךָ׃
"Avenge the children of Israel on the Midyanites. Afterward you shall be gathered to your people."
Drash דְּרָשׁ
Hurrying to the last task
Sometimes we put off a task because something frightening begins after it. The midrash compares two leaders: one hurried, the other lingered.
Midrash Tanchuma: Moshe (Moses) knew he would die after the vengeance on Midyan, and still he hurried to carry out the command. Yehoshua (Joshua), fearing the same fate, dragged out the war with the kings of Kenaan, and his years were cut by ten: he lived a hundred and ten, not a hundred and twenty like Moshe.
How Midrash Tanchuma explain it
Midrash Tanchuma Another explanation: Avenge the children of Israel
This is what Scripture says: "He does not withdraw His eyes from the righteous, and with kings on the throne He sets them forever, and they are exalted" (Iyov / Job 36:7). What is "He does not withdraw His eyes from the righteous"? The Holy One, blessed is He, does not withhold from the righteous what he wishes to see with his eyes. This teaches you that Moshe (Moses) longed to see the vengeance on the Midyanites before he died, and asked the Holy One, blessed is He, to see them with his own eyes. And of him it is said: "The righteous shall rejoice when he sees vengeance, he shall wash his feet in the blood of the wicked" (Tehillim / Psalms 58:11). "The righteous shall rejoice": this is Moshe. "When he sees vengeance": the vengeance on Midyan. "He shall wash his feet in the blood of the wicked": this is Bilam (Balaam).
Moshe said to Pinchas (Phinehas) and the soldiers: "I know that the wicked Bilam is there: he went to collect his wages. Before the wolf comes to the sheep, spread a net for him. And if you see that wicked one working sorcery, show him the gold plate on which is written 'Holy to the Eternal' (Shemot / Exodus 28:36), and he will fall, and kill him." "And they killed the kings of Midyan along with their slain": they were working sorcery with Bilam and flying in the air, and they showed them the plate, and they fell on their slain.
Our sages, of blessed memory, said: of Yehoshua (Joshua) it is written: "As I was with Moshe, so I will be with you" (Yehoshua / Joshua 1:5). And Yehoshua should have lived a hundred and twenty years, like Moshe our teacher. Why were they cut by ten years? Because when the Holy One, blessed is He, said to Moshe: "Avenge the children of Israel", although he had received the news of his death, he did not say: "Tomorrow I die, what use is it to me to take vengeance on Midyan?" Rather, he hurried to carry out the whole matter, as it says: "And Moshe sent them" (Bamidbar / Numbers 31:6). But Yehoshua did not do so. When he came to fight the thirty-one kings, he said: "If I kill them, I will die at once, as happened to Moshe our teacher." What did he do? He began with one and drew out the war with them, as it says: "Yehoshua made war a long time with all those kings" (Yehoshua / Joshua 11:18). The Holy One, blessed is He, said to him: "Is that what you did? I am cutting your years by ten." David said: "There are many plans in a man's heart, but the counsel of the Eternal shall stand" (Mishlei / Proverbs 19:21).
Takeaway
The gold plate (צִיץ) inscribed "Holy to the Eternal" was on the high priest's forehead (Shemot / Exodus 28:36–38).
Yehoshua died at a hundred and ten (Yehoshua / Joshua 24:29), and Moshe at a hundred and twenty (Devarim / Deuteronomy 34:7).
The thirty-one kings Yehoshua defeated are listed in Yehoshua / Joshua 12:9–24.