Hamas won a national election with a plurality in 2006 based on a platform of change - the PA/PLO had been in power for decades and hadn’t made satisfactory progress towards Palestinian liberation or the right to return for Palestinian refugees, while many Palestinians viewed the PA as collaborators or concessionaires to Israel for their financial corruption and unjust treatment of Palestinians.
Hamas was not elected on a platform of jihad or destroying Israel or killing all Jews, they were elected because they promised “hope and change” - basically a combination of Obama and Trump, and they promised to form a coalition government with Fatah. From most accounts, what happened in the first 6 months is described as an attempted coup, where Western forces tried to invalidate the election and return full power of the government to Fatah. There is a lot of political commentary about this saying that the Israeli government would not risk Hamas taking legitimate governmental control of the whole Palestine state. While the coup failed, there was warfare between the opposing faction - Hamas had control in Gaza and Fatah on the West Bank. Remember that these parties had almost a 50/50 split of electoral support. Israel partitioned them to isolate Hamas in Gaza, and Fatah declared an emergency government in the West Bank to take full control of it. Hamas retaliated against the coup attempt, partitioning, and military force that had been used to quell the fighting, by firing rockets into Israel. That is when the blockade started.
That is modern context of Gaza/Hamas. So to say that these are just inhumane terrorists who don’t represent Gaza, and the “Palestinian people don’t deserve this war” is a deficient and rudimentary description of what’s happening and why. The Palestinian people want liberation, and half of them voted for Hamas all those years ago because Hamas promised to help achieve that. Now for the past near 20 years the people of Gaza have been imprisoned, sealed off from the world, starved and abused, for what they believe is Israel refusing to let them choose their own government pursue liberation. All the while this state of young men has been radicalized in isolation by nihilist Islamist jihadism where the nation means everything and their life means nothing. The Hamas of Gaza in 2023 is a completely different organization than the party that was elected, and the circumstances mostly explain why.
You can say “none of these children ever voted for Hamas” that’s true - a lot of their dead parents and relatives did though, and that introduces a different type of loyalty and reverence. You have 10s of thousands of young people in Gaza who believe their people died for voting for Hamas, for voting for liberation. Now they are dying for it again. The cycle will continue.