וַיָּ֖מָת חֻשָׁ֑ם וַיִּמְלֹ֨ךְ תַּחְתָּ֜יו הֲדַ֣ד בֶּן־בְּדַ֗ד הַמַּכֶּ֤ה אֶת־מִדְיָן֙ בִּשְׂדֵ֣ה מוֹאָ֔ב וְשֵׁ֥ם עִיר֖וֹ עֲוִֽית׃
И умер Хушам, и воцарился вместо него Хадад, сын Бедада, поразивший Мадианитянина на поле Моавитском; и имя его города было Авит.
Or HaChaim
We have to remember that according to Bamidbar Rabbah 20,4 Balak used to be one of the princes of Midian, but the Moabites had appointed him as their king out of fear from the Israelites. When the Torah writes that "Balak saw," it reveals that the former prince of Midian who had seen what the Israelites had done a short while previously to the mighty king Sichon of the Emorites was just as much afraid of the Israelites as the Moabites. There was no need for the Torah to spell this out as everybody had taken note of the defeat of the mighty king Sichon. Subsequently, the Torah mentions that even Moav was afraid of Israel. The fact that both Moav and Midian feared Israel brought them closer together and they made peace with one another as is evident from the proposal made by the elders of Moav to the elders of Midian. Our sages also say in that same Midrash that the proof that the Moabites and the Midianites were warring is the verse המכה את מדין בשדה מואב, (Genesis 36,35). There was always hatred between these two peoples. The Midrash describes their relationship as like that of two dogs which always fight each other until threatened by a wolf. The reason that the Moabites humbled themselves and appointed someone from Midian as king over them instead of vice versa was that the Moabites needed the counsel of the Midianites amongst whom Moses had lived for many years.
Radak
ולבכותה, and to weep for her. These two verbs are used on occasion without the prepositions אל and על as for instance in Psalms 69,11 ואבכה בצום נפשי, “when I wept and fasted;” the meaning of the prefix ב in front of צום is equivalent to the preposition על, “I fasted on account of the threat to my soul.” Compare also Genesis 36,35 ויבך אותו אביו, “his father wept for him.”
Rashi
אל זקני מדין AND MOAB SAID] TO THE ELDERS OF MIDIAN But did not these (Moab and Midian) always hate one another, just as is stated, (Genesis 36:35) “who had smitten Midian in the country of Moab”, from which it is evident that Midian had come against Moab in war? But out of fear of Israel they now made peace between themselves (Midrash Tanchuma, Balak 3; cf. Sanhedrin 105a). And what induced Moab to take counsel of Midian? When they saw that Israel was victorious in a supernatural manner they said: the leader of these people grew up in Midian; let us ask them what is his chief characteristic. They replied to them; “His power lies only in his mouth (in prayer)”. Whereupon they said: “Then we must come against them with a man whose power lies in his mouth” (Midrash Tanchuma, Balak 3).