Who would benefit from a wide-scale military conflict in the Gaza Strip? And who would lose? What does weighing interests in the balance mean for Israel?

The smaller terrorist organizations in Gaza—Islamic Jihad, which operates as a satellite of Iran, and radical Sunni groups inspired by the Islamic State group—are the primary ones who want to ratchet up the violence into a full-scale war. For them, a major war in Gaza could be an opportunity to build themselves up on the ruins of Hamas. It also looks like Iran has an interest in escalating the situation in Gaza and pulling Israel into a war that will take away from its ability to focus on its main defense activity right now: keeping Iran from digging down in Syria.

The third player that is consistently working to worsen the situation in Gaza and torpedo Egypt’s efforts to broker a cease-fire is Palestinian Authority leader Mahmoud Abbas, for whom, as he once said in Jenin, “the worse things are, the better.” Some in Israel see value in assisting the P.A.’s attempts to regain control of Gaza, but even if that were the right thing to do in principle (and that’s doubtful), it is not feasible without a full-blown war that would end with the Israel Defense Forces occupying Gaza for many years to come.

What a war would not do would be to create a moderate, effective Palestinian leadership there.

All these considerations are counter-balanced, paradoxically, by Hamas’s interest in continuing to dictate the terms of any ceasefire with Israel while refraining from a war, which the Hamas leadership knows would be self-destructive. Its moves to escalate the conflict—arson balloons, breaches of the border fence—have been intentionally selected as ways of taking things to the brink without toppling over into the abyss.

Egypt also seems to have an interest in avoiding a war, despite the deep-seated mutual hatred between Hamas, who are the flesh-and-blood descendants of the Muslim Brotherhood, and the government of Egyptian President Abdel Fattah El-Sisi. Slowly, Cairo has come to realize that it is better to contain and deter an organization like Hamas while gradually delegitimizing it than to take it on directly.

And Israel? A harsh, well-defined blow is vital for it to maintain its mechanism of deterrence. A missile hitting Beersheva is not a trivial occurrence.

However, as far as possible, given the broader considerations of the regional balance of power, as well as Israel’s fundamental interest in avoiding a ground war, it would be best to make the most of Egypt’s mediation.

Col. (ret.) Dr. Eran Lerman, former deputy director of the National Security Council, is the vice president of the Jerusalem Institute for Strategic Studies.