Hamas also hoped that it would have more success against Israel than during its last war in 2008. After all, it had plenty of new, longer-range Iranian rockets that could reach most cities in Israel.
Iran also egged Hamas on. It believed that its client's rocket barrages would give Israel a very public taste of what it should expect if it ever dared to attack Iran's nuclear facilities - while Hamas's new rockets would outshine those of its rival, the Palestine Authority on the West Bank.
More importantly, Hamas figured it had two new friends nearby in Recep Erdogan's Islamist government in Turkey and the newly ascendant Muslim Brotherhood in Egypt under Mohamed Morsi.
By going to war, Hamas reminded the world that American allies like Turkey and Egypt are now firmly in the new Iranian-backed Islamist and anti-Israel orbit. Like Hamas, both regimes came to power through elections, and then almost immediately tried to silence the opposition to ensure their permanent authoritarian rule. In Morsi's case, the new Gaza war gave him cover for almost immediately trying to suspend the constitution.
In short, Hamas and its friends felt the advantages of war outweighed the risks. And even if things went badly, they counted on their patrons imposing a T-ball truce on Israel that would save Hamas from too much damage, while allowing it to brag about its supposed success, its new rockets, its new allies and its new American support.
For now, all that may have worked.
But just as the fantasies of T-ball give way when kids grow up and start keeping score in the real world of baseball, so too will the T-ball war in the Middle East come to an end. To avoid unending rocket barrages and serial on-and-off wars, Israel will have to convince Hamas and its allies that, collectively, they all have a lot to lose by starting more T-ball wars -- ones that in the future no longer will end with a no-score truce.