Hamas believed that Hezbollah, Palestinians in Jordan, Arabs inside Israel and possibly Syria would also join in with the assault. They didn't, only Hezbollah. Hamas officials posted on social media their disappointment, and pro-Hamas Muslims around the world expressed anger on X and in Telegram channels at what they saw as the failure and cowardice of Muslims in that region in not joining in and rising up. This was all shared and played out on social media at the time.
There's a NATO report that I can link you to with quotes from the Hamas leadership after the 2014 war where they said that civilians are used as human shields and martyrs for the cause and that they will fight till the last Palestinian is dead. The resulting war which inevitably caused civilian casualties as all war does feeds in to the propaganda war that their leaders have spoken about on Arabic tv. You can see the videos on Memri.
Hamas leaders and supporters revelled in the bad press Israel got after the war started and claimed repeatedly they were winning. So in their minds the destruction was worth it. Because their sole intent was to diminish and hopefully destroy Israel, or the 'Zionist entity' as they call it. Though what alternative was there, Hamas said they would commit further 7/10s, Israel has to protect it's people. Whether they've gone too far is another matter.
Negotiations stalled with Hamas demanding unreasonable requests like Israel paying to rebuild Gaza. Until Trump said Gaza would be cleared out and then Egypt and other ME countries came up with a day after plan to avoid Trump and Netanyahu following through with clearing out Gaza.
But that deal doesn't involve Hamas staying in power. That was never Hamas' plan, they always intended to stay in power. Now they've changed tact and said they want to evolve into a purely political party in the hope of being able to stay..
So they won, in that they've weakened Israel's standing internationally, it's not crumbled as they'd hoped, but they've lost in that Egypt wants them out, their people are rising up against them, the Palestinian Authority has called them sons of bitches and told them to get the hell out of Gaza, and the West appears to be strengthening their arch enemy the Palestinian Authority possibly with the view of the PA replacing them
So for most countries massive death and destruction wouldn't look like winning, but for Hamas it does. Or it did, but now they're losing because they're losing control and power