Stop me if you've heard this story before. Or rather, don't, because it's relevant to the current situation, and we have to bring the people who don't know the story up to speed first.
It's about a frog, doing whatever it is that frogs do on the banks of the Jordan River. Along comes a scorpion and asks the frog for a lift across to the other side. The frog demurs, pointing out that the scorpion might sting him.
"Don't be silly," says the scorpion. "Scorpions can't swim. I'd die too." So the frog says "Okay, get on my back," and off they go. Halfway across, the scorpion stings the frog.
As they both sink beneath the Jordan, the dying frog gasps "You're crazy. Why did you do that? You've killed us both." The scorpion shrugs (as much as scorpions can shrug), and says: "This is the Middle East."
People in the Middle East hate that story, but still...
Start with the fact that both Hamas and Israel's prime minister, Benjamin Netanyahu, have always had the same overriding goal: to thwart the "two-state" peace settlement that would have divided the territory known as Palestine between the Palestinian Arabs and the Zionist Jews.
That was the nightmare prospect that made Mr Netanyahu and Hamas objective allies. Each wanted all the land "between the [Jordan] river and the sea" for their own people, not some shabby compromise that divided it between them. They were enemies, but their prime duty to faith and to history, in the view of both parties, was to stop the two-state solution.
So in 1995, a far-right Jewish radical assassinated Israeli prime minister Yitzhak Rabin, the former general and war hero who signed the "Oslo Accords" that promised a two-state peace settlement.
The newly formed Hamas then helped Mr Netanyahu into power in the 1996 election by launching a terrorist campaign of bus bombings that drove enough Israelis into his arms to win the election. He was "Mr Security", and he would keep Israel safe from the evil terrorists.
He never said it in so many words, for obvious diplomatic reasons, but Mr Netanyahu implicitly promised Israelis that they could keep all of Palestine forever. No need for a two-state deal -- and on that principle, Hamas entirely agreed, even if its preferred long-term solution was to drive all the Jews into the sea.
Hamas and Mr Netanyahu never communicated directly, but that provided the basis for a 27-year cooperation between the two sides. Mr Netanyahu was directly in power for only 16 of those years, but the policy never varied: let enough aid through to keep Hamas viable in Gaza while undermining its rival in the West Bank, the pro-two-state Palestinian Authority.
What finally sabotaged this long collaboration was not the occasional outbreak of shooting between the Israel Defense Force and Hamas ("mowing the grass", the IDF called it), but the fact that Israel was making peace deals with the major Arab states. Without their financial and moral support, the Palestinian cause would eventually wither and die.
So Hamas needed a big war to derail that process: one that "martyred" enough Palestinians to shame the rest of the Arab world out of betraying the sacred cause.
The atrocities of Oct 7 were intended to goad the Israelis into fury and a "mighty vengeance" (Mr Netanyahu's words). Hamas wanted 11,000 Palestinians, half of them children, killed by Israeli firepower. It wanted the Israelis to smash up hospitals while trying to get at the Hamas bases beneath them.
This stuff is what they teach in the introductory courses on "guerilla and terrorist strategies" in every military staff college in the world. What they don't teach -- can't teach -- is how much force is too much.
Hamas's goal was just to kill the drift towards a "settlement" that made Israel an acceptable trading partner for Arab states and left all of Palestine permanently under Israeli control. It has certainly succeeded in that, but in doing that, it has also inadvertently awakened the sleeping monster it hates and fears most: the two-state solution.
Five weeks of bombing has sickened enough people elsewhere that the idea of two states in Palestine is back on the table. Whether it can actually work is no clearer than it was last time, but it's certainly not what either Mr Netanyahu or Hamas intended.