Every war produces winners and losers, but the traditionally downtrodden Shiite Moslems already have benefited from the long years of violence afflicting Lebanon.

That may not be the same thing as winning--a goal that has eluded almost all of Lebanon's collection of religious communities since the civil war began in 1975. But it has provided the Shiites with new self-confidence and power.

Even before the Israeli invasion, the Shiites, for the first time in centuries, were considered major local players.

More numerous than the Israelis' Maronite Christian allies--and with much of their population situated in the sensitive section of southern Lebanon where Israel wants a demilitarized zone established--the Shiites have assumed even greater importance since the invasion.

Together, Maronites and Shiites may well emerge as the dominant forces in a new Lebanon, in the view of observers here, although they predict that the old Maronite desire for control almost certainly will have to give way to a more equal sharing of power and responsibility if the relationship is to endure. Any such outcome would diminish the power of the mainstream Sunni Moslems who long dominated Islam in Lebanon.

Until recently the Shiites' greatest failing was seen to be lack of leadership of the unchallenged kind exercised for the Maronites by Bashir Gemayel, head of the major Christian militias.

The Shiites' once-powerful feudal chiefs long since have been discredited. Their first modern leader, an Iranian-born cleric, Imam Moussa Sadr, disappeared in Libya four years ago in still-mysterious circumstances.

His place has been taken by Nabih Berri, a mild-mannered lawyer with an American wife and family living in Detroit. Since the Israeli invasion, the reflective Berri has come into his own.

He heads Amal, the only one of Lebanon's many militias that resisted the Jewish invaders. In an interview, he said that if the Israelis launched an assault on West Beirut, where many Shiites live in shantytown suburbs, "we will do our duty."

His southern Shiites are among the many Lebanese initially delighted by the Israeli crushing of the Palestinians, but Berri was wary.

"I am afraid Israel wants an excuse to stay in the south and will create a pretext," he said.

Already the Israelis have paved what had been a rudimentary Palestinian airstrip, flooded the south with their goods, arrested and tried to uproot Amal cadres in villages ostentatiously handed over to their surrogate, a Lebanese ex-Army major, Saad Haddad.

Even before the invasion, Berri was flexing Amal's muscles.

Stirred by Shiite-dominated Iran's victories against Iraq and conscious of his 900,000 fellow Lebanese Shiites, Berri last month said his community was entitled to Lebanon's presidency--in the past reserved for the Maronites.

Behind the Shiites' emergence in Lebanese politics is Amal, Berri's militia. Despite its fragmentation--there are pro-Syrian, pro-Iranian and pro-Lebanese Army branches--Amal remains the most powerful force in Shiite society.

Amal helped transform a once-lethargic community of poor farmers and day laborers organized along largely feudal lines into the one Lebanese group that fought against Israeli troops alongside the Palestinians.

Indicative of Amal's hold on the Shiite community was the major switching of gears required for that decision, since the Shiites and the Palestinians have fought bloody battles for control of Beirut suburbs and much of predominantly Moslem West Beirut in recent years.

After the French put together Lebanon in its present boundaries in 1920 on the ruins of the Ottoman empire, the Shiites remained little better than a satellite force, controlled by their feudal lords in southern Lebanon and the fertile Bekaa Valley in the northeast and under the Maronites to whom France entrusted political power.

Between the two world wars, the Shiites served as allies to the Maronites, offsetting the Sunnis who remained unreconciled in large part to the Christian state.

The real power remained in the hands of the Maronite president under the unwritten Lebanese system of apportioning political offices to the country's many religious sects, and all prime ministers were Sunnis. Still, the speaker of parliament was a Shiite, and he had the right to official license plate number two.

In the 1960s, reformist president Fuad Chehab sought to weaken all feudal leaders in Lebanon. He offered the Shiites just enough opportunities and government jobs to give them the feeling that they were getting a fair share.

But by the late 1960s the greatest change in centuries was wrought when left-wing Lebanese and Palestinians began organizing the previously docile Shiite peasants in the south against their feudal masters.

When Israel began retaliating in 1969 for increased Palestinian raids across the border, the first of hundreds of thousands of Shiites fled to safety in Beirut, adding to the shantytowns and social problems that helped spark the civil war.

Under Moussa Sadr's leadership, the Shiites founded the Movement of the Deprived in 1973, which for the first time demanded a greater share of power.

Amal was established the next year--with Palestinian help.

During the civil war the Shiites had no organization of their own, but they fought in the ranks of the militias facing the Christians.

Since then, Amal has weaned away Shiite fighters from various Palestinian groups as well as the communist militias. In the past two years they also have fought bloody battles against the Palestinians to control the key southern suburbs and much of West Beirut.