Israel left Hamas alone hoping they would concentrate on bettering the lives of the people of Gaza. Instead of Hamas spent a fortune constructing an elaborate tunnel system, basically a fortified underground city. Then came the October massacre. The rest is history. No need for rocket science, as you say, to counter your argument that Hamas was justified in committing such atrocities.
Hamas squandered an opportunity to bring a better life to those they governed. Too late now.