The Israel and Iran conflict simplified…
In my opinion, Israel needed to divert the world’s attention from the fact that they are currently rapping up a decades long campaign to destroy the Palestinians and they would rather take a few missiles than risk the world finally saying enough.
So what actually happened? It depends on how far back you want to go actually, just to give context. Disregarding ancient history, a pretty good starting point will be around the late 19th to early 20th century which is sort of the tail end of empires. Be aware though that "big picture" scenarios often hide the very local complex politics and personalities involved and can paint a too simplistic narrative.
Zionism (the nationalist movement for a Jewish state) and Pan-Arabism (a nationalist movement for Arab state independence) began ,in Europe, around the end of the 19th century when most of the Middle East region was under the Ottoman Empire. Iran/Persia was the other great empire/nation going back into history. Persia and Turkey essentially wrestled for control over the Middle East region over centuries.
At the end of WW1, the Ottoman empire lost their holdings having been on the losing side after allying with the Germans. Britain and France divided what is today most of North Africa and the Middle East. This is the period when the infamous Sykes-Picot agreement and the various state lines of modern Middle East were established. Britain, in particular, had the Palestinian Mandate which encompasses what is now modern Israel, Jordan and the West Bank.
Basically the French and British decided to establish various nation states in the Middle East while a Pan Arabic movement was surging broadly encompassing Egypt, Saudi Arabia, Trans-Jordan, Syria, Iraq, Lebanon and Palestine. Meanwhile the British had also desired to form a Jewish enclave/nation to satisfy the agreement (Balfour declaration) with the Zionists. The big problem is Turkey and Iran (the historical regional powers and non-Arab) never really bought into this. The bigger problem is the personalities of the various Arab state leaders meant that pretty much all of them wanted to lead the formation of a Pan-Arab state. And the biggest problem is that the formation of the Jewish state was repudiated by all the Arab states. All of this basically came to a head in 1948 (although there was much conflict and unrest during the entire period) with nearly all Arab states waging war on Israel which they lost.
Iran was mostly ambivalent about Israel in the 1948-1953 (Iran's Mossadegh era). Under Shah Pahlavi (post 1953) Iran was fairly close to the "West" (US-British) since it helped remove Mossadegh from power (this came back to bite them) and therefore was friendly to Israel. This lasted until 1979 (Shia) Islamic Revolution in Iran. From then on, Iran was super hostile to Israel (not the least because it was very hostile to the US for helping bring the Shah into power).
By 1980 the Pan-Arabism movement had largely stalled. However Saddam Hussein brought on the Iran-Iraq war (1980-89) by invading Iran. Iran meanwhile, starts funding (Shia Muslim) groups like Hezbollah (formed 1982) in Lebanon to oppose Israel. So the area has a really complex mix of ethnic (Turkish, Kurdish, Arabs, Persians), intra religious/sectarian (Jewish, Coptic, Christian, Shia, Sunni, Wahabbis etc), tribal/monarchic (Omani, Saudi, Kuwaiti...), ideological/political (Socialist, Monarchies, Democracies, Theocracies) and nationalistic conflicts.
In the most modern form, Iran funds groups that oppose Israel on religious/political grounds (Hamas a Sunni group), some groups (Houthis, Hezbollah - Shia) on sectarian/ethnic grounds, and for national security/sectarian grounds (in Iraq, Syria). Israel opposes Iran due to this since they are nearly diametrically opposed on ALL grounds. Israel goes around killing and destroying these various Iran-funded groups and also significant figures in Iran (suspected nuclear weapons facilities, nuclear scientists, military coordinators etc). The most visible is attacking Hamas in Gaza as a response to the October attacks and the bombing and killing of Iranian military coordinator in an Iranian embassy in Damascus (Syria). The counter response was Iran firing missiles at Israel and the counter-counter response was apparently an attack in Iran conducted by Israel a few days ago.