It does have something to do with Iran, but just like Ukrainians being killed by Russia is nowhere as damaging to US military as taking the same losses in American citizens, the same holds true for Iran.
Iran's asset is sheer willing manpower they can recruit among the Muslim world and then throw against Israel. Hamas is basically at similar strength as prewar, Hezbollah likely begun mobilizing more soldiers than they had during October last year.
Is it moral or fair to the willing fighters sent into the meat grinder against Israel? Possibly not. The same is true for when NATO arms Ukrainians and tell them to run into kill zones. But this unfair relationship is of little consolation to the Israelis/Russians on the receiving end, who are feeling their whole nation being damaged, while they can't even directly fire back at the territories from which weapons and covert assistance is shipped to directly bomb and assault Israeli/Russian settlements.
The worst thing for Israel is the poor performance at the front causing life to be heavily disrupted in the country, while Russia is coping well and basically sending career soldiers to the front. But it's still a humiliation for Russia that her enemies can do this. For Israel, it's worse than a humiliation, it's a threat they can't resolve.
So did you pick A or B? You can't have C; we can't count all of Hamas/Hezbollah's kills as Iran's and all their deaths as divorced from Iran. That's an unnatural and illogical way of twisting the story to cope for Iran.
Israel doesn't seem to care much that it's not directly killing Iranians because killing Hezbollah or Hamas is all the same to them. They are killing people who want to kill them. Israel is eliminating people who are their enemies and that's what matters. In the big picture, it's also not that different from directly losing Iranians. Hamas and Hezbollah represent people who are willing to fight to the death against Israel; that's not even true for the majority of Iranians. These are valuable assets being killed by Israel; whether their passports/bloodlines are Iranian is a matter of semantics.
Also, Russia and Israel are both going to gain territory from this. Russia's gaining huge swathes of territory in Ukraine and it likely has an understanding with China that it gets credit for aiding China's unhindered development by siphoning all of the West's resources away into a Ukrainian meat grinder. The people dying in Ukraine might not be Americans or Europeans but what is your average drug-addicted lazy American/European good for anyway? War-hardened Ukrainians willing to fight and die against Russia are arguable more valuable as assets to the West and random Westerners.
So although Israel is not satisified with what they are getting out of it, that's because they have a fanatical belief that they are the chosen race and should run everyone over effortlessly while losing nothing themselves. I hate Israel. It pains me to say this. But, in the end, it looks like Israel will expand from this conflict and it will have done severe damage that would take decades to recover from, if they can at all, to the populations of Palestinians and Lebanese who are their enemies. It is quite possible, at this rate, that Israel can take Palestine off the map, and open a new front to expand its future territory into Lebanon. Israel has suffered as well, but with Western help, they can rebuild much faster and be back to business as usual in a few years after the conflict ends.
The Muslims don't have their shit together. They are taking much much more damage than they are dealing. I see no hope for them because they cannot unite and go all-in to destroy Israel once and for all, consequences be damned. To defeat Israel and remove this blight from the world, it will likely take a new world order under China to defang and remove their Western backers, then cripple them with unopposable force out of the hands of Muslim incompetence. Israel should be taken out of existence and the land returned to Palestine; they are a center for all evil built on land robbed from the Muslims by power-drunk Western countries.