They are fascists. They inherently believe in their own superiority, which causes severe miscalculations. Like the Nazis going to war with the USSR and Japan with the US.
Iran played it all pretty defensive, being content so far to build up their reservoirs while pushing their own technological developement in a very similar manner to China. That seemed to have been working for them, given the capabilities they have already shown. That gap would have only grown further as time stretches on, but it also restricted them when it came to their actions.
Personally, I think it was just an act of insane fascist idiocy that caused this attack on Iran. Sure, they wanted to get rid of the country that supplied their enemies in the region, but I doubt Iran itself would have ever intervened directly after they showed they wouldn't in Gaza. Having nukes would have changed nothing for Iran in that regard, as using them offensively would have been suicide. Which was why Iran had not really pursued them. Pissrael's best bet would have been to continue their push against Iran's allies like they had successfully done so far, depriving Iran of its allies while slowly expanding their settler project.
By attacking Iran under the pretext of swarting the developement of nukes, they aimed to beat Iran militarily now that they deluded themselves into thinking they might still have the upper hand. Ironically playing directly into the type of war Iran had been preparing for decades. Much like with the Nazis and Japanese, they saw a situation that would only get worse for them as Irans technological and military capabilities would keep growing, and the resistance was at its weakest point so far.
It was basically now or never for them for toppling Iran, but as it turned out, it could very well be never or never. If they cannot win this war conventionally, which it looks like, they might just be straight up fucked with no buts about it. The fallout of this might be literal though.
The US if they join. Or any other significant bourgeois imperialist.