(Deut. 2:2-4:) “Then the Lord spoke unto me, saying, ‘You have had enough of going about this mountain; turn north. Now charge the people, saying, “You are passing through the territory of your kindred, the children of Esau, who dwell in Seir.”’” This text is related (to Ps. 60:1), “To the director: With a shushan eduth; a mikhtam of David, for instruction.” When? (According to vs. 2,) “When he had struggled with Aram-Naharaim and Aram-Zobah, and Joab returned and smote Edom – [an army] of twelve thousand men – in the Valley of Salt.” Now was it not already stated (in I Kings 11:16), “For Joab and all Israel stayed there six months, until he had annihilated every male in Edom?”
And yet it repeats afterwards (here in Ps. 60:2, cont.), “Joab returned and smote Edom – [an army] of twelve thousand men – in the Valley of Salt.” This text is related (to Is. 50:8), “My Vindicator is at hand; who will contend with me; let us stand together […].” The Holy One, blessed be He, gave Torah to Israel, so that through it they would attain vindication before all peoples. You find that Joab was head of the Sanhedrin, as stated (in II Sam. 23:8), “These are the names of the warriors whom David had: one who sits in the seat of wisdom.” This was Joab. But David was wiser than all, since it is stated (in II Sam. 14:20 with reference to David), “my lord is as wise as the wisdom of an angel of God.” Still, they only acted on something in accord with the Sanhedrin, as stated (in Ps. 60:1), “To the director: with the shushan eduth (i.e., lily of witness).” “Shushan” refers to the Sanhedrin, since it is stated (in Cant. 7:3), “fenced in with the lilies (shoshanim).”
“Witness (eduth)” [is mentioned] because of the Torah, which is called a witness. “Mikhtam” refers to David, who became (a king [melekh]) [humble (makh)] and called himself, poor; innocent (tam), because he walked in innocence with his Creator. When? (According to Ps. 60:2,) “When he had struggled with Aram-Naharaim.” What does that mean? When Joab went to fight with Aram-Naharaim, they came out towards him.
They said to him, “You are one of the Children of Jacob, but we are from the Children of Laban. Now here is their confirmed agreement, as written (in Gen. 31:52), ‘This mound is a witness, [and the pillar is a witness that […] you will not pass beyond this mound and this pillar towards me with evil intent].’”
When Joab heard that, he returned to David. He said to him, “What do you say to that? Here is our ancestor Jacob's sworn agreement.” They immediately convened a Sanhedrin, (in the words of Ps. 60:1) “a shushan eduth (i.e., lily of witness) […] [for instruction].”
They instructed him and said, “It really was so, but they transgressed it first. Did Balaam the Wicked not say like this (in Numb. 23:7), ‘It is from Aram that Balak has brought me, the king of Moab…?’ Moreover, did not Cushan-Rishathaim (of Aram-Naharaim) enslave us, as stated (in Jud. 3:8), ‘and the children of Israel served Cushan-Rishathaim eight years?’ [Thus] they have committed two wicked acts against us.”
When the court had so instructed him, he immediately turned back against them and slew them, as stated (in Ps. 60:2), “When he had struggled with Aram-Naharaim and Aram-Zobah, and Joab returned and smote Edom – [an army] of twelve thousand men – in the Valley of Salt.” But did he not make war with Aram (i.e., Syria)? [So] shat is the meaning of “and smote Edom?” It should have said "and he smote Aram," not “Edom.” It is simply that when Joab came to fight with Aram, the children of Edom stood up to him and said to him, “Did not the Holy One, blessed be He, say to you (in Deut. 2:5), ‘Do not engage them in battle, for I will not give you of their land so much as a foot can tread on?’
Joab answered them, “Did he not say this to us (in vs. 4), ‘You are passing through the territory of your kindred, the children of Esau?’ Allow us to pass to our land! [But they did not want to do so.] Joab said to [his army], “If we eradicate Edom now, we shall find nothing to eat or drink on our return. Instead let us leave them alone until we have smitten Aram, and then we shall turn back against them.”
It is therefore stated (in Ps. 60:2), “[When he had struggled with Aram-Naharaim and Aram-Zobah,] and Joab returned and smote Edom – [an army] of twelve thousand men – in the Valley of Salt.” The Holy One, blessed be He, said, “What benefit is it for you that you smite Edom little by little?” [As we also find that] Abishai ben Zuriyah killed eighteen thousand, “and (in II Sam. 8:14), all the Edomites became vassals of David.”
When the time comes, I will destroy and eradicate it, as stated (in Obad. 1:19-21), “They shall take possession of the Negeb and the Mountain of Esau…. They shall possess the Ephraimite country and the district of Samaria…. And the exiles in this army of the Children of Israel…. For saviors shall go up on Mount Zion to judge the Mountain of Esau.” At that time (ibid., cont.), “the kingdom shall belong to the Lord.”