Israel supports Hamas financially several times, a.) so they can justify a crackdown on Palestinians b.) to weaken the other political groups in Palestine that wanted to negotiate with Israel so only the most radical group is left to represent Palestinians, right wing Israeli assassinated the prime minister who negotiated a peace deal with PLO and the right wing is now in represented at top o government in Israel.
https://en.wikipedia.org/wiki/Israeli_support_for_Hamas
random sampling of newspaper articles about Israel's support of Hamas
https://www.jpost.com/israel-news/benjamin-netanyahu/article...
https://www.nytimes.com/2023/12/10/world/middleeast/israel-q...