doggybag Hamas didn't exist until 1989, born out the Arab League and Israeli intransigence and oppression. They weren't elected until 2006 after Arafat carked it. Arafat, although presented as an extremist nutjob, was at least someone who you could talk to, but talking was getting the Palestinians nowhere so Hamas jumped into the vacuum with a more radical agenda, which over tme has become more radical and extreme. Interesting to note there have been no elections to the Palestinian authority since - it has indeed become a totalitarian authority.
Iran only became extremist after the revolution in '79 when they deposed the US, UK and French supported corrupt Shah. In order to retain power they picked on the Great Satan that is the US as a rallying point which remains to this day. I'm not sure Iran has the stomach for an all out war as it would take much to kick off internally because they'e not exactly popular after the recent bout of woman and student bashing/killing internally. Then there's the Kurds in the north who have unfinished business in Iraq, Iran and Turkey. The Sunni Shia schism is also an issue for them to deal with should they go for it. Hezbollah is like their plaything to wind the US and the Israelis up and they're very good at it.
Equally the Israelis (always a provocative right wing and militaristic government whether under the guise of Labour or Likud, have significantly shifted further to the right under Netanyahu, whose most recent elections was flaky to say the least. They are now the most rightwing and religiously extreme government the Israelis have ever had and that's going some. As Lapid, the losing opposition leader said (to paraphrase) 'good luck with that'.
The Israeli Zionist lobby in the US is very strong and always offers support to the more extreme Israeli policies (eg support for settler land grabs) which in turn drives US foreign policy in the region. The US are also happy to cash in on sales from the military industrial complex.
Its a perennial vicious circle I'm afraid, where each side seems to be attempting to be the most extreme, each blaming their extremism on the actions of the other. Until that stops there is no hope and many more innocents on both sides will die.