They know exactly what they are doing.
Should they get the chance, their intention to repeat October 7th has been clearly stated - it's in their charter. What does anyone do under those circumstances? For those who argue that Israel is an illegitimate State, I guess the practical question is where should the 9.5 million colonialist Israelis move to? And who would accept them?
"There shall be no recognition of the legitimacy of the Zionist entity". https://www.middleeasteye.net/news/hamas-2017-document-full
Hamas was specifically funded by Netanyahu to prevent a 2SS:
https://www.timesofisrael.com/for-years-netanyahu-propped-up...
And he weakened the moderates on purpose. So what we need to do is the opposite of Netanyahu's strategy - empower the moderates, move towards a 2SS and sanction/isolate/disempower Hamas and similar.