The fitful battle for control of southern Lebanon has evolved from a brutal replay of this country's civil war into a proxy war between Syria and Israel.

Both are openly supporting the rival sides in the struggle, Syria allied with Palestinian guerrilla forces and Israel backing Lebanese Christian militiamen. It is trench warfare, conducted largely by shelling with artillary and rockets, bringing ruin and devastation to the villages and tobacco fields of this isolated region.

The confrontation carries the grave risk of all out war between Syria and Israel. But, in an odd way, this risk has also imposed a certain restraint, a set of unwritten rules, that keeps the two sides from going too far.

From the Palestinian guerrilla outpost atop a windswept hill outside this abandoned village, for example, Israeli positions are within rifle shot and Israeli towns within easy reach of heavier weapons. Yet, the Palestinians seldom shoot at them. This is partly because they would be defenseless if the Israelis responded with air strikes, but also, according to wellplaced sources, because the Syrians have told them not to, fearing that it could touch off a war with Israel for which Syria is not prepared.

The Israelis train and supply the Christian forces and, according to some reports, occasionally take part in the shooting. They have not bombed or strafed the Palestinian positions, however. Nor did they take action when troops of the Saiqa faction of Palestinians, many of them believed to be Syrian regulars, moved into the border area where Israel would not tolerate overt Syrian presence.

"There is an unwritten agreement that this is a proxy war," a Palestinnian official said. "The Syrians don't want us to provoke a war they might lose. But the Israelis are nibbling away at Lebanese territory. The question is how long this can go on."

Analysts on both sides and independent observers in Beirut say it can go on indefinitely. The Lebanese Christians are still bitterly opposed to the presence of the Palestinians, whom they believe to be responsible for the civil war, and the Palestinians are determined to keep control of the only place in the Arab world where they still have some freedom of action.

"I think the Christians can hold out as long as they keep getting help from the other side," a military analyst in Beirut said. "They see themselves as the crusaders fighting the Saracens down there and they're serious about it."

A spokesman for the Christian factions said they were "embarrassed to be allied with the Israelis. Our preference would be solidarity with all the Arabs. But the Palestinians have been left to do what they want down there and you can't have two authorities, two courses of power, in one country. It's the same old problem we had through the whole war.

Lebanese government officials, Arab diplomats, and officers of the Syrian-dominated Arab peacekeeping force that has restored order in the rest of the country meet regularly to discuss ways of halting the fighting in the south, but there is no sign they are near a solution.

South Lebanon, the region between the Litani River and the Israeli border, was largely spared during the civil war that ravaged the rest of the country but is a battleground now, caught in the larger struggle between outside forces.

Nabatiye, the principal Moslem-controlled town, is shelled regularly and is beginning to look like a miniature Beirut. Thousands of residents have fled the region to become refugese in their own country. Entire villages have been reduced to ghost towns and others, while still populated, are without water and electricity.

The war here developed when the Palestinians, subdued by the Syrians in the civil war, regrouped in the hills of south Lebanon. For the Israelis, who had enjoyed a respite of nearly two years while the Palestinians fought against other Arabs in the Lebanese war, this represented a threat of new action against them. They backed the militia of the Christian villages along the border, apparently hoping to set up a buffer between themselves and the Palestinians.

The Christians are backed up against the border but hold two large salients, one around Marjayoun north of the Israeli town of Metullah, and another to the west below Bint Jbail. Israel had equipped the Christians with the American-made 155-mm howitzer, the largest field gun used by U.S. forces in the Vietnam war, according to military sources, and the Palestinians have received the Soviet-made 30-mm cannon, which has a range of nearly 30 miles.

With these and a host of smaller weapons, the two sides are blazing away at each other's territory, although the confrontation lines have been static since early April.

The Arab peacekeeping force has been unable to move into the region to halt the fighting because Israel objected on the grounds that this would put the Syrian army in a position to threaten Israeli security. The post-war Lebanese government headed by President Elias Sarkis has not yet rebuilt the shattered national army, so Lebanon had no force of its own with which to restore order.

At the same time, neither side is able to escalate the fighting. The Palestinians were reportedly restrained by Syria from storming and capturing Marjayoun in April and are still under restraints that keep them from mounting a decisive offensive.

The Christians, who are estimated to have no more than 1,200 fighters in the south, have been prevented from bringing in reinforcements from their strongholds in the north by a sea blockade by the Syrians.

It is reliably reported that the Israelis are widening and paving an old road from the border to the village of Kfar Chouba, and may be planning to continue north toward Majayoun. Palestinian leaders are citing this as a provocation that should bring a strong Arab response, a move that has broken the unwritten rules, but so far they have not attempted to launch a ground attack against it.

The Christians are also claiming that the involvement of the Syrians is escalating. The commander of their forces had takep part in the shelling porters last week that regular Syrian forces had taken part in the shelling of Christian positions.

Diplomatic source in Beirut say this form of brinkmanship by both sides is increasing the danger of full-scale war but there is no sign that a solution is imminent.