From the Israeli side, no government can let its population get shelled indefinitely. Further, the only reason to deal with Hamas, a government that does not even recognize Israel's right to exist and ranks the utter destruction of the Israeli government and "restoration" of the area to Palestinain control (quotes because you cannot "Restore" a situation that did not ever actually exist) is if they can provide Israel with the on thing it wants -- security. So the argument that Hamas cannot stop the various factions from lobbing rockets into Israel doesn't actually matter. As a practical issue, a government that can't provide needed security gaurantees is as useless to Israel as one that is complicit in the attacks.
From the Hamas perspective, they need two things -- an end to the economic blockade and the restoration of PA prisoners. Without those, they have no legitimacy with their own people and no reason to engage in even indirect negotiations with the "Zionist entity." For various Hamas factions, the continuation of the economic blockade and the holding of civilians as prisoners is proof of Israeli bad faith. Whatever the Hamas leadership may want, it cannot be seen as engaging in negotiations that amount to surrender by having a cease fire and securing no progress on either critical front.
So we need to go through a cycle of violence that will permit Hamas and Israel to return to the status quo ante, where neither side can hope to defeat the other militarily or make significant concessions pending some other development that would somehow change the conditions on the ground. Alas, all the ones I can think of make matters much worse. The result is that, if all parties behave rationally within the scope of their political constraints, they must actively work to make a bad situation worse so that they can present a restoration of the bad situation as needed forward progress.
The only likely alternative is what nearly happened in Summer of 2006, when all sides seriously underestimated the likely response from the other and the situation spun completely out of control.
Anytime Mashiach wants to show up and put a stop to this nonsense, I am sooooo ready.