Hamas leaves traps in the buildings with explosives when they leave an area to kill Israelis. The IDF has to detonate these traps to make an area safe, this is the cause of most of the destruction. John Spencer talks about the details if you're genuinely curious.