https://victorhanson.com/the-players-of-the-gazan-war-and-their-strategies-part-one-the-terrorists-of-hamas-and-hezbollah/
Hamas
Hamas was quite clever in lying to the IDF, Mossad, and the Israeli government that it was finally resigned to fostering its own internal development. Its guest workers inside Israel—sometimes 20,000 a day—supposedly were emissaries of goodwill and would spike prosperity in Gaza. Hamas talked of its rivalries with the Palestinian Authority and for a bit quelled its eliminationist rhetoric—as if it was useful to Israel to play off Hamas against Abbas and the West Bank. Again, all a clever ruse as it crafted a plan to kill more Jews in any one day since the Holocaust.
So meanwhile for a year Hamas planned and trained, likely with the Iranians, to stage a mass-murder raid into Israel—at peace, during the holidays, early in the dark of morning, and ironically to be staged 50 years almost to the date after the similar surprise attack on Israel that had started the Yom Kippur War. Hamas in other words would then brag it had done more damage to Israel in a single day than any other terrorist organization in history.
So the overall killing strategy of Hamas was clear enough. Send 2,000 gunmen through the wall, via the air, and at sea to murder unarmed Jewish civilians, and butcher and mutilate them to such a savage degree that the murderers would either so shock the Israelis by their inhumanity that the Israelis would be stunned into concessions, or the inhuman butchery would at least suggest to the world that only premodern people so oppressed could be capable of such animal-like cruelty. That is, the world would eventually blame Israel for reducing Palestinians to such a state of bestial despair.
Then the Hamas killers and their tag-along opportunistic civilian counterparts would retreat with Israeli captives, the more elderly, young, and vulnerable the better. So the second part of the strategy was to leave the mutilating behind, get safely back to subterranean Gaza to hide the captives in their network of tunnels, and then either use them as shields to deflect retaliations or to swap some children and women for Hamas killers jailed in Israel or threaten to kill them all unless the IDF relented and stood down—or all that and more.