To understand Egypt’s involvement in the attempts to broker a deal between Fatah and Hamas and bring about a ceasefire in the Gaza Strip, we need to look at a timeline of Cairo’s interests. A ceasefire in Gaza would prevent another military conflict between Israel and Hamas that would bring more ruin on the population in Gaza, which is already in a humanitarian crisis, suffering from serious shortages of running water, food, electricity, and medical and educational services.

Egypt wanted to restore its status as the leading Sunni Arab state and a regional power, a status it lost after the Arab Spring of 2011, when President Hosni Mubarak was ousted by a popular revolution and his Muslim Brotherhood successor, Mohammad Morsi, was ousted in a military coup led by current President Abdel Fattah El-Sisi.

Egypt looked on bleakly as Saudi Arabia took its place as the central Sunni Arab power and Shi’ite Iran coalesced its power throughout the tumultuous Middle East. Meanwhile, even as the radical terrorist group Islamic State collapses in Iraq and Syria, the group’s Sinai branch continues to flourish.

El-Sisi, who is having some success in his bitter battle against Islamic State and other terrorist groups in Sinai—mainly because of Egypt’s security ties to Israel, which are better than they have been since the Egypt-Israel peace treaty was signed—is slowly restoring Cairo to the status of a regional power. Proof of that can be seen in the fact that the Gaza leadership, despite being wooed by Iran, still prefers Egypt as a broker in the intra-Palestinian fracas and even in the Israeli-Palestinian conflict. First and foremost, that means a sustainable cease-fire in Gaza.

Someone had to fix the breakdown between the Palestinian factions, which prompted Palestinian Authority leader Mahmoud Abbas to issue increasingly harsh sanctions against Hamas and the civilian population of Gaza, which in turn have been turning up the pressure on Israel. Hamas is not trying to make military gains, but rather political ones that will ease conditions for the population and prevent discontent among the Palestinians in Gaza.

El-Sisi has charged Egypt’s General Security Service, headed by Abbas Kamel, to do something about Gaza. Egyptian intelligence services have seen that Hamas wants political achievements. At the same time, in order to maintain strong security ties with Israel, Egypt has managed to keep another war in the Gaza Strip at bay, despite Hamas and the other Palestinian factions’ repeated provocations and the growing number of Palestinian casualties in the weekly border-fence riots.

The Egyptians’ original approach was to skirt the intra-Palestinian conflict and try to stabilize the violence. But Abbas refused, letting Egypt, Israel and other Arab states know that they were not sovereign in Gaza and had no authority there. Let Hamas pay the civil employees’ salaries, he said. Egypt, fearing that Abbas would call for additional sanctions in Gaza, torpedoed a plan put together by its own intelligence service.

Egypt wants to re-establish its status as a regional power, and the crises in Gaza and between the various Palestinian factions are important to Egyptian interests. Optimistically, if the Egyptians continue to involve themselves in the process of reaching a Gaza ceasefire and implementing a Palestinian reconciliation agreement, another war between Israel and Hamas will be kept at bay. But if Egypt decides to pull its finger out of the Palestinian pie and concentrate on its own internal security matters, another war against Hamas is inevitable.