Israel is in Gaza because they have funded and supported Hamas, in the hope they would use those funds to invade them, giving them pretext for a genocide.
“Anyone who wants to thwart the establishment of a Palestinian state has to support bolstering Hamas and transferring money to Hamas … This is part of our strategy – to isolate the Palestinians in Gaza from the Palestinians in the West Bank.” - Benjamin Netanyahu [1]
[1] https://www.theguardian.com/commentisfree/2023/oct/20/benjam...