The theory goes: if Hamas were to embarrass Israel on the public stage with a humiliating attack, this might provoke an overwhelmingly disproportionate response by Israel against Gaza, cementing the public perception of Gazans as the victims in the conflict even in light of the 10/7 aggression - and Hamas as their freedom fighters. This in turn would attract public sympathy for Hamas, bolstering their political prospects in Palestine, meanwhile derailing Saudi peace talks that might have resulted in formal recognition of the Palestinian Authority as the legitimate sovereigns. (Neutralizing peace talks between the two greatest enemies of one of Hamas's greatest benefactors, Iran, could only be viewed as a nice "plus").
[0] https://www.arabbarometer.org/media-news/survey-sheds-light-... [1] https://www.washingtoninstitute.org/policy-analysis/polls-sh... [2] https://www.youtube.com/watch?v=zMxHU34IgyY