The most likely goal we're aware of was to disrupt the normalization talks that were going on between israel and some other nations, with a side goal of the usual thing of provoking wildly disproportionate retaliation against the gaza civilian population, and probably at least partially to try to draw the IDF away from supporting the murderous settlers on the west bank.
The brutality the 10/7 attack involved was, to all appearances, significantly due to how little resistance hamas encountered; without that, it might have ended up largely just a hostage exchange sort of situation (this is your reminder israel holds several hundred/thousand palestinians in detention, many of them for political reasons rather than anything reasonably called criminal) rather than literally nakba mk 2. Unfortunately, the IDF had prioritized giving cover to lynchings over defending the border they shared with hamas, and here we are

The first 2 have, to all appearances, worked, incidentally. The third... sorta'. It did, but the settlers ramped up the murder and displacement efforts even with less military support, so it didn't exactly help the situation in the west bank much.