Mohammed Salem / Reuters

Apart from the destruction and death and sometimes paralyzing fear, one memory sticks in my mind from reporting in the Hamas-controlled Gaza Strip during the 2014 war with Israel. It occurred on the terrace of Gaza City’s al-Dera hotel, overlooking the Mediterranean Sea. A few days earlier, an Israeli airstrike had killed four young boys playing soccer on the beach below the terrace, in full view of the assembled foreign press corps. This day, my translator, a middle-aged Palestinian man, looked out at the sea and sighed: “The Israelis are going about this all wrong.”

There was nothing to live for in Gaza, he said. People couldn’t earn a salary, couldn’t get married and start a family, and constantly feared dying just as senselessly as those boys on the beach below. Life was hard in the West Bank, to be sure—but Palestinians had enough to lose that they thought twice about heading down the road to war.

Four years later, the line between war and peace in Gaza remains paper thin. Of the dozens of mortars fired into Israel on Tuesday, one in particular served as a stark reminder of this fact: The shell came crashing down near a kindergarten in the southern Israeli kibbutz of Ein Hashlosha in the early morning hours before children had arrived. If it had landed in the same spot a half hour later, as parents milled around at the beginning of the school day with their sons and daughters, Israel and Hamas would likely be at war today.

More than 100 rockets and mortars were fired into Israel since Tuesday morning, according to the Israeli military, marking the largest barrage by Gaza militants since the devastating 2014 war. The Israel Defense Forces responded by launching 65 airstrikes on positions belonging to Hamas and Palestinian Islamic Jihad, an Islamist faction close to Iran. An Egypt-brokered truce appears to be holding, as Hamas has unilaterally declared a ceasefire and Israeli officials have suggested they have no intention of further strikes at this moment. Whether this represents an end to this round of fighting, or a mere lull, remains to be seen.

Since 2014, life for those in Gaza has only become more difficult. The reconstruction effort has stalled, leaving much of the area still in ruins; a UN report found that the Strip had become effectively “unlivable.”

There is a minority within the Israeli military establishment who argue that it is precisely these conditions which make further conflict inevitable. Giora Eiland, a former general who served as head of Israel’s National Security Council, made the case to me that Hamas, a U.S.-designated terror group, was not akin to al Qaeda or the Islamic State, as Prime Minister Benjamin Netanyahu has claimed—rather, it was an authentic representative of the people of Gaza. What’s more, he said, a serious reconstruction effort would better serve Israeli security interests than constantly waging war on the Strip. “All of these [reconstruction projects] can create a good motivation for the government of Gaza, and will give them some assets that they will not want to lose,” he said. “Because they understand that if they resume another cycle of violence against Israel, the final result may be a destruction of all these important projects.”

The official Israeli policy, however, aims to keep the peace in Gaza through brute strength. This was evident in the Israeli response to the mass protests dubbed the “Great March of Return” demanding Palestinians’ right of return to present-day Israel, which spurred this week’s military confrontation. During the protests, Israel bombed Hamas facilities unrelated to the protests, Nathan Thrall, the director of the International Crisis Group’s project on the Arab-Israeli conflict, wrote in an email. “Under normal circumstances, Hamas and other organizations would retaliate in some way to such attacks,” he said. “Because all of the organizations in Gaza wanted the protests to continue, they bit their tongue in the hope of avoiding a new war or escalation that would put a premature end to the demonstrations.”

As the protests wound down, that reason for restraint disappeared as well. The current conflagration began after Israel killed three fighters belonging to Palestinian Islamic Jihad after the group, which is close to Iran, planted an explosive device near the border. Palestinian Islamic Jihad retaliated with the barrage on Tuesday. “Israel viewed the barrage as Islamic Jihad and Hamas seeking to ‘change the rules of the game,’” said Thrall. “But for Islamic Jihad and Hamas, [it] was precisely the opposite: It was an attempt to restore the old rules of the game, in which Israel was to expect a response when it attacked targets in Gaza.”

The Israeli military sees an Iranian hand behind the violence. Palestinian Islamic Jihad “takes its marching orders from Tehran,” said Amos Yadlin, a former head of Israeli military intelligence. Iran enlisted the group to strike Israel in retribution for Israeli strikes against Iranian soldiers and facilities in Syria in recent months, he said, and once the clashes had begun Hamas had no choice but to join in. “It could not allow itself to be perceived as marginalized in the context of the Palestinian struggle against Israel.”

It is indeed true that Hamas has repaired its alliance with Iran over the past year. When I last met with Hamas officials, several weeks ago, they told me that their ties with Tehran were stronger than what they had been before the Syrian war—a conflict in which Hamas found itself on opposite sides from its powerful patron, and which resulted in a severe deterioration of the relationship. Given this regional dynamic, it is possible that Hamas did not believe it was in a position to restrain Islamic Jihad, Tehran’s ally, once it decided to retaliate.

But Hamas’s relationship with its southern neighbor, Egypt, might pave the way for a de-escalation of the conflict. Egyptian officials see Hamas as an organization with ties to both the Muslim Brotherhood, the military-backed government in Cairo’s mortal enemy, and to Tehran, the preeminent foe of its primary regional ally, Saudi Arabia. Hamas supported former Egyptian President Mohammed Morsi, a member of the Muslim Brotherhood, but officially severed its links to the Brotherhood last year in a bid to improve ties with Egypt and Gulf states.

Despite their differences, Hamas officials are well aware that they cannot afford to ignore Egyptian wishes. Geography, in this case, is destiny: Egypt controls the southern crossing with Gaza, and also has the power to destroy tunnels used to smuggle goods that run under the border. For this reason, Hamas’s leader, Ismail Haniyeh, visited Cairo shortly before this month’s “March of Return” protests in a bid to assuage Egyptian concerns about the demonstrations. And it may account for Egypt’s success so far in reestablishing the ceasefire between Hamas and Israel.

“Neither of the two sides wants a war now because Hamas knows it will pay a very heavy price, and Israel is focused on its northern front [with Lebanon and Syria],” said Yadlin. “Israel is also cognizant of the fact that it is difficult to produce any strategic achievements through another round of fighting in Gaza.”

That might be the logical response, but wars have a logic all of their own. If that mortar shell landed in that kibbutz’s kindergarten while it was full of children, the furious Israeli response would have no doubt provoked a furious Hamas retaliation—and the two sides would have come to believe that there was no alternative to war. “Neither Israel nor Hamas want a war right now,” Thrall said. “But both are dangerously close to participating in one.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.