The fighting between Gaza and Israel Friday and Saturday, which was led in Gaza by the Islamic Jihad under orders from Iran, is tied to a power struggle between Islamic Jihad and Hamas over credit for the protests along the Gaza-Israel border fence as well as for the benefits that will come from an anticipated agreement with Israel, Israeli security officials believe.

The Islamic Jihad has taken a significant leadership role in the weekly protests near the border fence between the Gaza Strip and Israel that have been ongoing since March 30. Therefore, its people believe the movement has the right to reap some of the expected benefits from the agreement, including money for salary payments and for infrastructure development. This has led to tensions between the Islamic Jihad and Hamas, resulting in the Islamic Jihad firing rockets at Israel.

>> Analysis: Gaza fuse is getting shorter as Netanyahu risks losing control of the conflict

Iranian involvement is also connected to the fight over leadership of the weekly protests. Iran wants Gaza's residents to see it as a country that stood by them in recent months and is responsible for the improvement in their situation. Tehran wishes to prevent Egypt, Qatar and the UN – who have been mediating between Israel and Hamas – from receiving any credit. To this end, Iran is paying about $100 million a year to organizations in Gaza and families of Palestinians killed and wounded in the protests.

Israeli security officials believe that the Iranian Revolutionary Guards’ Quds force in Syria did not tell the Islamic Jihad when exactly to fire rockets. Nevertheless, the organization coordinates with Iran, which supports it financially.

Israel says that Hamas bears responsibility for events in Gaza, and the Israel Air Force attacked dozens of Hamas targets over the weekend in response to the rocket fire. However Israel also understands that Hamas did not want this weekend’s rockets.

After smaller organizations have fired rockets at Israel in the past, Hamas made arrests and came down hard on them. But it has a problem when it comes to the Islamic Jihad. The latter is the second-largest group in the Strip and is very influential. Hence, and because of the Islamic Jihad’s close relationship with the Quds Force and with Hezbollah, Hamas treads carefully, even after the Islamic Jihad fires rockets. Hamas did demand, however, that the Islamic Jihad cease hostilities and promised it that it will receive some of the money that will come in to the Strip as a result of an agreement with Israel.

Despite the rocket fire, Israeli government officials decided over the weekend to try to come to an arrangement in Gaza. The decision was made among other things out of the Israel’s security officials' belief that Hamas wants to reach an agreement and that extremists like the Islamic Jihad and rogue actors are trying to harm the process. Moreover, in contrast to media reports on Saturday, security officials said they are not aware of a threat by Hamas that it is demanding money by Thursday or else it will turn up the flames near the fence.

In Israel, officials say that talks and agreements with Hamas via Egypt are more effective than those conducted with the Palestinian Authority over Gaza. This understanding has led political and security figures to change their concept regarding Hamas: Israel no longer wants to topple the Hamas regime. Instead, it believes that it will be possible to reach an agreement with a weakened and deterred Hamas that will bring quiet to the south. Still, the security establishment’s main concern is that this might lead to a further decline in the humanitarian situation in Gaza, in case the PA stops sending hundreds of millions of dollars a month to the Strip.