The fanatical mind works differently.
Their strategy is based on attrition and being able to absorb losses,
the recipee is simple.
The "cause" is like a plant, you water it with blood,
the effect takes time and it's all cumulative regardless of losses...et voila
Only through such "logic", if you can call it that, that you can try
to understand Meshaal's and other Hamas leaders' delusional
and hypocritical comments such as
"our losses are tactical, their losses are strategic" (Meshaal)
"we need the blood of women and children" (Haniyya)
"we have nothing to do with a day that sees no blood" (Sinwar, my weak translation)
Hypocritical because they're coming from leaders who
run away, hide their kids and other civilians be damned,
stash millions of dollars
and preach from Qatari villas or Turkish hotels
to people contemplating the dust of their flattened homes,
we call them the hotel jihadists.
With respect to your comment about urban warfare,
I believe they thought holding 250 hostages was a checkmate
and miscalculated Israel's next move. Many writers and commentators believed that too
except the average man on the street, "they'll get creamed".
Israel's decision to go to total war in spite of the hostages was a game changer.