"Lord, when is it going to end?" an exasperated resident of Kiryat Shemona in northern Galilee asked, as he emerged from a bomb shelter this week after anthoer long night of ear-splitting bombardment from across the border in Lebanon.

It is a question that was on the mind of every Israeli for two weeks before today's dramatic cease-fire announcement, whether or not he lived within range of the dreaded "Stalin organ" multiple rocket launchers operated by Palestinian guerrillas. But another question, just as pertinent, is likely to linger for a long time, regardless of whether the guns remain silent. How did it all begin? And why?

The simple explanation, which ignores the depth and complexity of Israel's motivation for unleashing the most devastating series of attacks on Palestinians in Lebanon since its full-scale invasion to the Litani River in 1978, is that the current cycle of cross-border violence began as just another series of "eye-for-an-eye" clashes on July 10.

That is when Israeli pilots flying F4 and F16 jets on a "routine" mission over Lebanon spotted a convoy of trucks with mounted Katyusha rockets moving south of the Zaharani River and raked it with air-to-ground missiles, bombs and cannon fire. The planes also bombed Palestinian antiaircraft positions just north of the river.

It was the first Israeli air strike in Lebanon in more than a month, and it shattered a lull that coincided with a request by Egyptian President Anwar Sadat to Israeli Prime Minister Menachem Begin to halt preemptive strikes while U.S. special envoy Philip C. Habib plied between Beirut and Jerusalem seeking a formula for Middle East Peace.

Within hours of the Israei air strike, a barrage of Palestinian Katyushas rianed on Kiryat Shemona, destroying a synagogue, damaging an apartment block, injuring 14 civilians and touching off a two-week Israeli-Palestinian battle of attrition that resulted in the deaths of seven Israelis and hundreds of Palestinians and Lebanese civilians.

But behind the narrow reprisla aspects of the cycle of violence that the July 10 Israeli Air Force sortie touched off lies a broader and more ominous strategic turn in the long and bitter struggle between Israel and the Palestinians of the exile community.

From the Israeli side, it reflected a fundamental decision by Begin and his Cabinet ministers to try to eleminate, once and for all, the capacity of the various guerrila organizations under the umbrella of the Palestine Lbieration Organization either to launch potent cross-border attacks on Israel or to defend tyhemselves effectively against the kind of limited preemptive Israeli ground and air operations that had been routinely conducted since 1979.

The watershed in the development of this strategic shift came on July 17, when Israeli planes conducted a massive bombing raid on PLO headquarters in downtown Beirut, killing an estimated 300 persons and signaling a resolve by the Begin government to cause havoc in the political infrastructure of the Palestinian organizations even if it meant a risk of lives of Lebanese civilians living in densely populated Beirut.

But in retrospect, the signs pointing to a dramatic escalation in the intensity of Israel's military operations in Lebanon, although unrecognized at the time, were abundant long before the Beirut air raid.

For weeks, the Israeli defense establishment -- the Army, the Defense Ministry, the office of chief of military intelligence and the public relations apparatus of the Israeli defense forces -- had been warning of an unprecedented buildup of weaponry in the hands of the Palestinian guerrillas in Lebanon.

In an extraordinary flurry of interviews, press conferences, speeches and background papers, Begin, who is also defense minister; Lt. Gen. Rafael Eitan, Army chief of staff; Maj. Gen Yehoshua Saguy, Army intelligence chief, and other military leaders portrayed Lebanon as being host to an enormous arsenal of sophisticated weaponry, much of it recently arrived at guerrilla bases from the Soviet Union, Syria and Libya.

Armed with vast new quantities of Soviet-made T55 and 54 tanks, long-range 130mm guns, multiple rocket launchers and SA9 missiles, the military leaders said, the Palestinians were within reach of becoming one of the best-equipped conventional fighting forces in the Middle East.

"You must understand that what is happening among the terrorists in the recent period is a military strengthening with up-to-date heavy weapons in large quantities," Eitan warned.

The alams over the abuildup, however, were for the most part lost in the crisis atmosphere that p revailed at the time because of the deployment of Syrian surface-to-air missiles in the Bekaa Valley of eastern Lebanon following the April 28 downing of two Syrain helicopters by Israeli planes. It was generally assummed here -- incorrectly, as it turned out -- that the official hand-wringing over the buildup in Lebanon was connected with Israeli intentions to attack the Syrian missiles, rather than presaging a massive new air offensive against the Palestinians and the start of a new cycle of violence.

Moreover, propaganda campaigns directed against purported increases in the Palestinians' military strength are not so uncommon in Israel. While it has been widely suspected by veteran observers of the Israeli-Palestinian conflict that Begin would probably decide eventually to complete the objective that the 1978 Litani invasion failed to complete -- to drive the guerrillas back beyond striking range of the border -- it was assumed that this would be accomplished by another sweep into southern Lebanon by ground forces.

Israel's objective in Lebanon, as articulated by Begin and his senior military strategists, was to turn the clock back two years, to the time when then-defense minister Ezer Weizman theorized, correctly, that the guerrillas could be contained with selective, limited ground and air preemptive strikes designed to disrupt their ability to organize terrorist forays acorss the border into northern Israel.

Using reports from its extensive intelligence apparatus in Lebanon, the Israeli defense forces were able to pinpoint incipient cross-border raiding operations and strike them at thier source -- usually small guerrilla camps from which terrorist squads were dispatched to the border by land, or small "naval bases" along the Mediterranean coastline from which seaborne Palestinian commandos set off in motorboats for the Israeli shore.

Weizman's tactic worked, and there have been no successful cross-border raids since two Israeli were killed in an ambush attack on the Misgav Am border kibbutz in April 1980. Similarly, Palestinian shelling of northern Israeli settlements dropped off to an unprecedentedly low level, and the northern frontier enjoyed its quietest period in years.

But, in the Israeli view, the recent buildup of armament by the guerrillas posed an ominous risk to Israel's security, and the previous policy of selective, limited strkes conducted only when necessary became obsolete.

"It has been clear to us for a long time that the terrorists are heading for extremes," Deputy Defense Minister Mordechai Zippori said last week. "This is evidenced by the large quantities of more sophisticated weapons they have begun to receive. . . From our observations, we know that they are attempting to regroup, and this is one of the main reasons that we have recently increased our disruptive actions."

Moreover, because the buildup of Palestinian arms included defensive weapons, such as surface-to-air missiles and radar-guided conventional antiaircraft guns, it was believed to pose a threat to the Israeli Air Force's ability to conduct even the limited preemptive strikes.

The next phase of the escalation came after the guerrillas' massive rocket response to the July 10 Israeli air strike. Begin, after consulting with members of his ministerial defense committee, ordered the attack on Beirut.

It seems clear now that Begin's decision was reactive, made in frustration and anger, rather than part of well-defined plan geared to a timetable. Israeli sources said that while the strategy of disrupting the guerrillas' political infastructure and attempting to cause chaos in the chain of command from Beirut to the field had been under consideration for months, it had not been discussed recently until Begin received news of rocked attacks on the resort town of Nahariya on July 15.

Begin confirmed the reprisal nature of the Beirut attack shortly; after the Israeli planes returned when he proclaimed that Israel sought vengeance for the three killed and 25 wounded in Nahariya, saying, "We shall give the enemy no rest until we have put an end to this bloody rampage . . . "

However, the furor in the Reagan administration over the large casualty toll in Beirut -- and the subsequent suspension of delivery of 10 F16 jets to Israel -- appeared to have neither surprised nor unduly offended most members of Begin's inner circle.

While some Cabinet members complained privately that the United States was turning out to be an untrustworthy patron, giving in too easily to Arab pressures, Begin's senior aides largely accepted the inevitibility of the U.S. decision.

When told the suspension in a telephone conversation the night of the Beirut raid, a close adviser of Begin's replied casually, "It sounds very logical. I can't expect the United States to release any planes when there is still fighting on the northern border. We understand the embarrassment of Washington . . . [But] I don't think this is an embargo. It's only a matter of style."

The belief that Israel is too valuable a strategic asset to the United States for a lasting schism to develop in U.S.-Israeli relations pervades the Begin government, and Israeli officials rarely make an attempt to mask it. It was succinctly illustrated by Cabinet Secretary Aryeh Naor, who in an interview published in the Jerusalem Post, declared:

"The Americans don't sell us planes because of our beautiful blue eyes. They sell them because of the common strategic interests between us and them. But these strategic interests are founded on a strong Israel, and an Israel besieged by the PLO is not a strong Israel . . . We will get the planes."

A policy planner in Begin's Likud Party put it another way: "We know we are a strategic asset to the United States, and we know the United States knows it. We also know that the United States knows that we cannot be a strategic asset unless we are strong and our borders are secure."

While relations between Israel and the Reagan administration are unquestionably bruised -- and no doubt will remain so for a while despite the cease-fire arranged today by Habib -- that perception of the "special relationship" between the two countries is likely to linger, whether or not the guns in the north remain silent and the Israeli bombers stay far away from Palestinian targets in Lebanon.

If the cease-fire breaks down, and the now-familiar cycle of violence resumes, it can be expected that the posture of Begin and his government toward perceived United States interference in what Israel views as legitimate self-defense will revert to what it was before.