For Donald Trump, peace seems simple. On July 1st, the American president announced on social media that Israel had agreed to the “necessary conditions” for a ceasefire in Gaza. It matters little that neither Hamas, the Islamists still governing parts of Gaza, nor Israel had endorsed the idea. If they did not, Mr Trump warned, things would “only get worse”, writes The Economist.

Yet ending the war in Gaza has repeatedly proved far from simple. There have been two temporary ceasefires during the 21 months of conflict, but no lasting peace. Israel continues to kill dozens of Palestinians every day. Compare that with its latest fighting against far more powerful enemies. Israel’s war in Iran lasted 12 days; its victory over Hezbollah, the powerful Shia militia in Lebanon, took eight weeks on the ground. But in Gaza, the Israeli government cannot even define what an end to the war would look like. Perhaps it is just another episode in a conflict between Jews and Palestinians that is more than a century old and will not end with a ceasefire.

Or perhaps this time will be different. An adviser to Binyamin Netanyahu, Israel’s prime minister, says he is “optimistic”. The commander of the Israel Defence Forces (IDF) argues that Israel has almost achieved its war aims in Gaza. The prime minister’s far-right allies strongly oppose ending the war, but the opposition leader, Yair Lapid, has promised to support a ceasefire. Netanyahu will travel to Washington next week to meet Donald Trump, who has made clear that he expects the war to end.

Yet the war on the ground continues. The IDF controls most of Gaza. It has once again told civilians in Gaza City to evacuate ahead of further attacks. The death toll rises relentlessly. More than 500 Gazans have been killed while trying to collect food from the controversial aid centres set up by Israel. Its troops are blamed for most of the deaths.

Why does Israel still fight in Gaza, when it was able to bring its wars against Iran and Hezbollah to a swift end? These enemies presented unique challenges. Iran had thousands of ballistic missiles capable of hitting Israel. Hezbollah had weapons supplied by Iran, trained fighters, and controlled most of Lebanon and parts of Syria. But the Israeli government had clear and achievable objectives in Iran and Lebanon. It sought to suppress the Islamic Republic’s nuclear ambitions and end Hezbollah’s military presence on Israel’s northern border. Using guided munitions and intelligence provided by well-placed spies, Israel was able to achieve its aims in relatively short campaigns.

When Israel began its war in Gaza, it also had clearly stated objectives: to end Hamas’s rule, destroy its military capabilities and rescue the 250 hostages held in Gaza. Since then, Israel has devastated the coastal strip, killed almost all of Hamas’s leadership and killed more than 55,000 people (it says a third were fighters). But Hamas still controls parts of Gaza. Its military wing is weakened, but there is no shortage of young men prepared to fight. And 50 hostages remain in captivity.

As the war has dragged on, Israel has suffered from mission creep. Its leaders speak vaguely of “total victory”. But few in the security establishment think much more can be achieved in Gaza by military means. Five IDF divisions are operating there. “We are mainly waiting to see whether there is a ceasefire,” an officer tells The Economist. “There is hardly any progress on the ground.” Most Israelis want a ceasefire. Only a minority think that eradicating Hamas, depopulating Gaza and leaving Israeli troops there is feasible or desirable. But those keeping Netanyahu in power want it.

Israel’s decision to continue its assault on Gaza goes beyond military tactics and political calculations. “For more than half a century, Israel has been unable to decide on a national strategy,” says Or Rabinowitz of the Hebrew University. “Does it ultimately want diplomatic agreements, or is it on a messianic quest for the Greater Land of Israel?” Israel’s wars with Iran and Hezbollah were “classic counter-proliferation campaigns”, she continues, “where your goal is to degrade your enemy’s capabilities and compel it to accept an arms-control treaty through diplomacy”. In Gaza, the prime minister and his ultra-religious allies “have fought a messianic war that goes beyond any pragmatic strategy”.

Israel achieved peace treaties with Egypt and Jordan because these disputes were matters of agreement over where the borders should be, Tom Segev, a historian, tells The Economist. Perhaps such a peace could be possible with Iran. “But with the Palestinians, Israel has a conflict that concerns the roots of each side’s national identity.” Gaza, whose population is largely descended from refugees who fled during the Nakba (catastrophe), as Palestinians call the 1948 war, “still has no solution”. Even many Israelis who oppose the far right’s vision of ethnic cleansing in Gaza cannot see any alternative future relationship with it. “Hamas was prepared to sacrifice more than 50,000 of its own people for the dream that one day they could displace Israel. And Israel was prepared to kill those 50,000 with the illusion that Gaza would no longer pose a threat.”

“Unlike Gaza, where we see only hatred, most interactions on social media between Israelis and Iranians are very positive,” says Sharona Mazalian of Tel Aviv University’s Center for Iranian Studies. The two countries were allies until the Islamic Revolution. “It was an alliance based on the fact that both countries were not Arab… outsiders in the Middle East,” says Dr Mazalian. Israelis and Iranians now have a common enemy in the regime, she believes: “They can hardly wait to live in peace again.”

For Gaza, there seems to be no such hope…