The dramatic July 2 killing of a Palestinian teenager—thought to be retaliation for the kidnapping and subsequent deaths of three young Israeli students—has sparked widespread outrage, protests, and riots among Palestinians in Jerusalem, the north of Israel, and parts of the West Bank. Within Israel, the situation has escalated, with inflammatory political statements, calls for revenge, riots, and open clashes between Jewish and Palestinian citizens of Israel. In the West Bank, the Israeli Defense Forces (IDF) continue with raids, arrests, and controversial house demolitions.

Rocket attacks originating from Gaza and Israeli strikes on the strip have both intensified over the past few days, with more than 85 rockets fired on the south of Israel on July 7. Hamas has claimed responsibility for the recent attacks, Israel is broadening its military strikes on Gaza in what they have officially announced as “Operation Protective Edge,” and the November 2012 ceasefire has collapsed. Despite the escalating violence, it still seems that Israel, Hamas, and Fatah would all prefer this to another all-out war. But their rhetoric, which attempts to balance domestic political pressure with strategic interests in preventing another war, may drive them toward conflict.

For Palestinian President Mahmoud Abbas, a new cycle of violence in the West Bank risks bringing down the unity government and further weakening the Palestinian Authority (PA). If the PA chooses to stand at the margins of a new full-scale cycle of unrest, they would project weakness, risk international condemnation, and validate some of the Palestinian public’s criticism of their dysfunctional relationship with Israel. However, if the PA attempts to subdue the unrest, they would lose further legitimacy at home, particularly since Abbas’s condemnation of the kidnappings attracted significant domestic criticism.

While the calculation to avoid escalation is relatively straightforward for Abbas and the PA, Hamas’s strategic considerations are more complex. The group has an interest in preserving the unity government and in delegating at least some of its political responsibilities, allowing some much-needed economic relief to flow into Gaza. Of course, the political arrangement does not address, let alone resolve, the deep political differences between Hamas and Fatah. But for the time being, both parties are in dire need of a popularity boost, making cooperation the most attractive option. Preventing another high-profile Israeli military campaign on Gaza is also in Hamas’s interest so long as the group remains economically vulnerable and lacking in regional support.

Hamas is attempting to balance its interests in preventing an escalation with several competing needs. The group has been engaging in militant rhetoric; publically rejecting a reported Egyptian-brokered ceasefire; and first allowing, then leading, a surge in rocket attacks. Yet behind closed doors, Hamas has been sending signals about its readiness to de-escalate and ease tensions. These contradictory actions are explained by the group’s needs, including protecting its reputation and image as the Islamic Resistance. In the past two months, Hamas has struggled to deal with growing criticism and defiance from local Salafi-jihadi factions, which have been responsible for the vast majority of the over 60 rockets fired at Israel during June 2014. Autonomous action by local jihadi factions has been a repeated liability for Hamas in the past few years, as Israel holds Hamas responsible for any military action from Gaza, thus heightening the chance of a tit-for-tat escalation.

Hamas also needs to ensure internal cohesion and prevent intra-organizational feuds, which would have ensued had the group not reacted to the dramatic events following the kidnapping of the Israeli teens. The group has been under deep internal pressure from its armed wing to respond to Israel’s campaign against Hamas in the West Bank, such as the recent killing of seven Hamas members and the arrest of the former prisoners who were released in the Gilad Shalit deal.

Hamas seems to be making the assumption that its recent actions and defiance of ultimatums will not lead to another all-out war, banking on Israel’s reluctance to orchestrate another full-scale military campaign in Gaza. But the group’s strategy—to project strength, which improves its domestic reputation, and keep internal conflict at bay through a short-term escalation—is an extremely risky gambit as pressure mounts in Israel to show “determination” against Hamas.

At this point in time, Hamas stands to lose a great deal from a full-scale military campaign. Nor has it benefited from the failed kidnapping operation. Indeed, if the central leadership was directly behind the abduction, then their failure to keep the hostages alive and use them as bargaining chips in a future prisoners’ exchange diminishes the group’s status and prestige. Its timing could also undermine the very same political reconciliation that Hamas needs at this moment. But if the kidnapping was the result of a rogue operation, then Hamas projects disunity and weakness and risks fallout from an attack it did not oversee or participate in. This second scenario is especially plausible, given the group’s history, which is rife with internal conflict and prior cases of small military cells acting to undermine ceasefires agreed upon by the central leadership.

The Israeli government is also struggling with competing interests. Prime Minister Benjamin Netanyahu has also been under pressure—chiefly from within his own political allies—to send a “strong signal” following the kidnapping. Now, Netanyahu and his cabinet find themselves at a crossroads, deciding whether to scale down the current operations or whether to orchestrate a broader military campaign, including a ground operation, in the Gaza Strip.

Part of Israel’s political and defense elites, including Netanyahu’s former political allies Jewish Home party chairman Naftali Bennett and Foreign Minister Avigdor Lieberman, have been calling for another all-out military crackdown on Hamas. They argue that any other course of action would project weakness and undermine Israeli deterrence to both Hamas and other belligerents. At the same time, significant internal opposition remains to a full-scale military operation in Gaza that would be highly costly and would risk igniting another Intifada. And with Salafi-jihadi groups on the rise, detractors doubt the rationale, let alone feasibility, of overthrowing Hamas. Accordingly, the collapse or implosion of Hamas’s rule in the strip would lead to instability, potentially strengthening the role and power of local Salafi-jihadi cells, an outcome even less appealing for Israel.

Looking at the competing needs and interests of the parties, it still appears that they would benefit from preventing an escalation—in contrast with their own rhetoric and with attempts to “square the circle” between domestic credibility and strategic interests. Yet the growing violence and the absence of a clear external broker place Israel and Hamas on the brink of yet another military confrontation.

Benedetta Berti is a post-doctoral fellow at Ben Gurion University, a research fellow at the Institute for National Security Studies, a lecturer at Tel Aviv University, and the author of Armed Political Organizations.