Quoting some of Chananya Weissman (here):
Yalkut Shimoni on Vayishlach, remez 140:
מָשָׁל לְבֶן מְלָכִים שֶׁהָיָה לוֹ דִּין עִם אֶחָד וְכָלוּ מְזוֹנוֹתָיו וּבָא אֶחָד וְהִסְפִּיק לוֹ מְזוֹנוֹת וְאָמַר הַמֶּלֶךְ אֵין לִי עֵסֶק אֶלָּא עִם זֶה שֶׁהִסְפִּיק לוֹ מְזוֹנוֹת
It can be compared to a prince who had a quarrel with someone, and [his adversary] ran out of food, whereupon someone came and supplied him with food. The king said “My business is only with the one who supplied him with food.”
In other words, the patron of your enemy is your enemy.
If your adversary in a war is on the brink of defeat due to lack of food, weapons, and other critical supplies, and someone comes along and sends them aid, your first business should be with them.
This is not presented by Chazal as a novel teaching, but as common sense, a mashal intended to shed light on why Hashem will destroy Batzra (for propping up Edom). Anyone with an ounce of intelligence understands that one who feeds, supplies, and army your enemy is also your enemy — even if they have a “reason”.
Hypothetical question: If someone steadily props up your enemy, then orders you into death traps to wage a “war” against this enemy, who is the more sinister and dangerous enemy in the equation?
