The reason for Israel's invasion of Lebanon in 1982:
Israel said it invaded Lebanon in June 1982 to stop PLO attacks from southern Lebanon and push Palestinian fighters far enough north to protect northern Israel.† The immediate trigger was the attempted assassination of Israel’s ambassador in London, Shlomo Argov. But that attack was carried out by the Abu Nidal group (based in Iraq), not the PLO, and Israel used it as the opening for a much broader war: destroying the PLO’s power in Lebanon, besieging Beirut, weakening Syrian influence, and trying to install a friendly Lebanese government. So, bluntly: there was a real security problem, but the 1982 invasion was also a war of choice and political engineering, not just self-defense.
† Right before the June 1982 invasion, the "they were shelling Galilee" line is weak: even the IDF says that after the July 1981 Habib ceasefire, "from July 1981 to June 1982, the Israeli-Lebanese border was quiet."
"Unprovoked" is wildly inaccurate, and not even the most anti-Israel historians like Pappé claim that. The provocation was very clear: the PLO paramilitary bombarding Israeli towns from southern Lebanon.
If Mexican cartels started bombarding San Diego, would anyone say that a US response was "unprovoked"?
If Israel was going to kill tens of thousands of people, it had an obligation to have a plan which wasn't completely stupid. I don't see what WASN'T stupid about it.