Israel arms ISIS-jihadists to fight against Hamas just like they armed Hamas to fight against the PFLP.
You may ask yourself “when will they ever learn?” but that's assuming the Israeli government's goal is to live in peace. Why should they need to learn, when arming terrorist groups that destabilize and escalate this conflict isn't a mistake?
Considering how much genocide, ethnic cleansing, settler colonialism and hence the expansion of their borders they have been able to justify due to hamas; considering their main argument behind stopping the entry of humanitarian aid was because they were sometimes raided by terrorist militias, which as it now turns out they funded, it was a worthy investment.