It looks very much to me as if Hamas counts on the existence of the dense population as some sort of I'll use the word 'protection' against military reprisal.
If we are going to talk about numbers, let us remember that over 2000 rockets have been fired into Israel since the start of the conflict.
From The Guardian
'The asymmetry between a well-resourced and equipped professional state army and paramilitary groups that have been operating under siege conditions for seven years or more is clear in this conflict. Even so, the IDF has encountered fiercer fighting than it expected on the ground.
"We have to admit we were facing good fighters, very well equipped with sophisticated weapons systems, accurate weapons, heavy weapons including mortars, booby traps," a senior military source told the Guardian after the battle of Shujai'iya, Israel's bloodiest assault in the two-week Gaza conflict. "It was very difficult fighting. It's very difficult for us to surprise them. They were simply waiting for us."
He said Hamas had the advantage of knowing when and where Israeli ground forces would strike following warnings given to civilians to evacuate specified areas by given deadlines. Hamas fighters hid in apartment buildings ready to ambush the IDF. They had also booby-trapped buildings and tunnels.'
You can believe what the press says or choose not to, of course. There seems to be a predisposition on this thread to believe press reports about the conflict so maybe this particular article will be of interest.
It goes on:
'Israeli forces have discovered a much more extensive network of tunnels than expected. The labyrinth of interconnected passages, bunkers, command centres, weapons stores and underground rocket-launching sites, with multiple shafts, has been dubbed Lower Gaza by some. Hundreds of thousands of tons of concrete have been used for construction of tunnels, some of which are 30m below ground and run for several miles.'
Interesting to note how much concrete there is available for tunnels but apparently because of the blockade there is none available for homes, schools, hospitals and other infrastructure; and even with all the tunnels built from all that concrete there is still so little (allegedly) by way of medical supplies, etc. for ordinary Gaza residents. Yet the IDF encounters anti-tank missiles and rocket propelled grenades, etc.
That sort of hardware costs a good deal of money.