Your enemies are My enemies – Mattot
Moses is told by God (Num. 31:1-2) to carry out “the vengeance of the Children of Israel” against Midian, but Moses in the following verse speaks not of the vengeance of the Israelites but “the vengeance of the Lord”.
Whose vengeance was it, Israel’s or God’s?
The Midrash notices the problem and suggests that what Moses was doing was emphasising that when Israel was hurt, the Almighty felt the pain.
God was standing up for Israel. When Israel had an enemy, God Himself was under attack. If God regarded the Midianites as His enemy, it was because they had taken up arms against Israel and caused them trouble.