Israel's Labor Party, out of power for six years, seems not to have mastered the art of being the loyal opposition.

Beleaguered by ambivalence over the paramount issue of national security and unable to reap decisive political advantage from a deteriorating economy, Labor is kept on the defensive by conservative Prime Minister Menachem Begin's popularity.

In a fresh example of party uncertainty, most Labor members of parliament abstained Monday in the legislature's vote approving the U.S.-mediated agreement with Lebanon providing for an Israeli troop withdrawal.

This year's 35th anniversary of Israeli independence marks a melancholy milestone for many of Labor's old war horses, who dominated Israeli politics for nearly three decades before being thrust into the opposition in 1977.

The political heirs of European Zionists and socialists who laid the foundation of the Jewish state, Labor's leaders said at independence day celebrations last month that they can look back with pride and satisfaction.

The name most closely associated with the turbulent events of 1948 and the birth of Israel, David Ben-Gurion, was one of theirs.

But this is 1983, hard times for those who were so long a part of the country's ruling elite and for their younger compatriots who can only dream that their time to run the country is still to come. The man now most closely associated with Israel is Begin, whom Ben-Gurion always refused to address directly during their parliamentary debates.

At the moment, Labor finds itself in the uncomfortably helpless position of waiting for its chief opponent to die or otherwise pass from the political scene. The virtually unanimous opinion of political analysts and other observers holds that none of Labor's potential leaders--not party leader Shimon Peres, his bitter rival Yitzhak Rabin or even the popular former president Yitzhak Navon--can win as long as Begin heads the governing Likud bloc.

Labor's ambivalent position on the invasion of Lebanon 11 months ago illustrates its difficulties. It endorsed the initial assault aimed at establishing a security zone in southern Lebanon but began to withdraw its support when troops drove deeper into the country and besieged Beirut.

Party leader Peres said Monday that Labor could not support the Lebanese accords because they did not lay down a precise timetable for bringing Israeli soldiers home from Lebanon, Reuter reported. Opposition speakers said the loss of nearly 500 Israeli lives in Lebanon was not justified by the results as embodied in the agreement.

Last fall, Labor leaders rallied hundreds of thousands of their countrymen in central Tel Aviv to demand an official investigation into the massacre of Palestinian refugees in Beirut. The inquiry commission cited Israel's "indirect responsibility" for the massacre and portrayed Begin as barely in touch with the workings of his own government.

Presented with this political windfall, however, a hesitant Labor party only watched and hoped for a domestic upheaval that might return it to power without forcing it to face an election that it knew it would lose.

"It is very difficult for them to get used to the idea they are not in power," remarked Yosef Goell, a writer for the pro-Labor Jerusalem Post. "It is a daily insult."

Labor's ranks enjoyed a brief flurry of optimism two weeks ago when a poll commissioned by the newspaper Haaretz showed that Labor today would win a national election. Polls in previous months consistently had predicted a Likud victory, however, and Begin's position appears strong.

For the United States,Israeli domestic politics are of more than passing interest. An entrenched Begin government with an ineffective domestic opposition has a free hand in fulfilling its ideological dream of eretz Israel--an Israel that includes as an integral part the occupied West Bank.

Such a government presents an immense, perhaps insurmountable barrier to diplomatic initiatives such as President Reagan's Sept. 1 Middle East peace initiative or any other plan that calls for Israel to surrender control of any part of the West Bank.

A Labor-led Israeli government would not deliver up the entire West Bank as part of a peace settlement. It was Labor, after all, that established the first Jewish settlements in the territory, and the party remains united with Begin in its opposition to a return to Israel's pre-1967 borders or any change in the status of Jerusalem as Israel's "undivided and eternal capital."

Along with the country as a whole, Labor has grown more militantly rightist and, if returned to power, would have to guard constantly against attacks from the right by adopting the toughest possible negotiating positions. But it would, its leaders say, be willing to negotiate the return of some of the West Bank to Arab control. The Begin government is not.

The one potentially serious vulnerability in Begin's ascendancy, many here say, is the domestic economy. A crazy-quilt system run by capitalists but built on a socialist foundation laid by their Labor party predecessors, the Israeli economy is riddled by rampant inflation, declining exports and constant labor strife. Last year's inflation rate was an astronomical 133 percent, and April's cost-of-living increase was the highest ever for a single month.

But even on the economic issue, Labor has its problems. The economy's health is tied closely, especially in the public mind, to the level of aid that Israel receives from the United States.

To speak of anything but increasing U.S. aid is to walk into a deadly trap fraught with accusations of near treason, but that is exactly what some Labor members did last fall.

After speaking privately with some of the party's leaders, Max Frankel, editor of The New York Times' editorial page, wrote that they had concluded that a peace settlement involving the West Bank was possible "only if the U.S. helps them topple the Begin government. And to that end leading opposition figures now risk political oblivion by counseling sharp cuts in America's nonmilitary aid of $800 million a year."

The entire Labor leadership denied saying anything of the sort. But the Likud has filed away Frankel's report for use in the next elections.

The fall of the Labor Party came in 1977, but it was long in the making and there were, in retrospect, many warning signals.

The immediate reasons for Begin's first election victory were evident at the time--bitterness over the near-disastrous 1973 war, a series of scandals in the Labor government, and deep division in the party. But there also were long-term underlying causes that are still at work.

Labor lost ground in the 1965 election, a trend that continued in 1969 and 1973. The crisis of the 1967 war brought Begin--who had seemed condemned to a lifetime in opposition--into a government of national unity, making him for the first time a "legitimate" Israeli political figure.

All of this time, a smug Labor party, obsessed with internal party and bureaucratic matters and the crisis-filled business of running the country, did little to change. Its leadership remained rigid and oligarchic, according to Myron J. Aronoff, a Rutgers University political scientist who has written extensively on the subject.

"The Labor movement took it for granted that the Labor philosophy that established and created the state would continue," said Haim Bar-Lev, the party's secretary general. "The assumption was things would continue as they were. The Labor leaders were too busy running the country to do party work. They took things for granted."

While Labor's second generation fought the wars of succession, they failed to reach out to younger Israelis interested in the country's politics. Zev Chafets, a former director of the government press office and devoted Begin ally, says:

"Talk to the young people in the Likud, the young Knesset parliament members, the mayors of the development towns. They will all tell you the same thing. They got out of the Army, went to the local Labor Party headquarters and were turned down."

While Labor ruled, the nature of the country and its politics gradually were changing. Perhaps the most important factor was the huge influx of Oriental or Sephardic Jews, hundreds of thousands of whom emigrated to Israel in the late 1940s and early 1950s from North Africa and the Arab countries of western Asia.

They went through a painful transition, by all accounts made worse by the attitude of superiority among the ruling Ashkenazim Jews of European and North American ancestry who ran the Labor Party and the government agencies so vital to the new immigrants. The Sephardim were shunted off to barren development towns in the countryside or packed into the beginnings of urban slums, filling the most menial jobs.

"The first generation accepted it humbly," said Ami Gluska, an aide to Navon, whose family migrated here from Yemen. "They had no power to resist. But the second generation has given expression to that insult."

Begin, in opposition to the ruling Labor party elite through all these years, became a natural vehicle to express their resentment.

"The basic change happened in 1977," according to Herb Smith, a prominent political pollster here. "And the source is all in the Oriental part of the population... There has been very little change in the European vote."

To make matters worse for Labor, the country's population trends are running against it unless it can find new ways to appeal to the Sephardic community. Sephardim are now a slight majority in the country, Smith said, and each year 60 to 65 percent of the young people reaching the voting age of 18 are of Oriental background.

Smith and others cite one other important trend that has benefited Begin--the decline in the importance of ideology in Israeli politics. Ideology was everything in the old days, but television, polling and other modern techniques today make the personality of the man at the top of each party slate of far more importance than the platform.

It is a politics made to order for Begin, whose years in the wilderness of opposition honed his skills as a master in the use of religious and nationalistic symbolism of mass appeal.

When the Sephardim look at their political choices, Gluska said, this is what they see:

"Begin is a Jew. Peres is an Ashkenazim."

The 1981 election was extraordinarily close. Begin's Likud bloc, in coalition with smaller right-wing religious parties, gained only a one-vote majority in parliament.

But since then Labor's fortunes appear to have declined. The Begin government has increased its majority to four votes, and Begin's personal popularity shows no sign of flagging.

Labor secretary general Bar-Lev worries about Begin's appeal on the central question of the future of the West Bank. He says the next generation of Israelis, those born after 1967, are "being taken to the West Bank settlements and told that this is real Zionism and these settlers are the real pioneers."

But the country remains sharply divided on the issue, Bar-Lev said, giving Labor a possible path back to power if it knows how to use it.

"If you manage to get to those people who are open-minded and not fanatics and explain the differences between the 1920s and the 1980s--between Israel having to govern 2 million Arabs or only 700,000 Arab-Israelis--if you can get to them you have a chance," he said.

"If you don't, you don't have a chance."