The shaky ceasefire that President Carter finally pulled off in southern Lebanon this week was the result of a drama boldly played out here, in Israel and in Saudi Arabia totally concealed from public view.

The stakes were far higher than suspected, both for Jimmy Carter's slim hopes for an Arab-Israeli settlement and for U.S. relations with two intimate Mideast allies: Israel and Saudi Arabia.

For the first time, the President sent a tough private warning to Israeli Prime Minister Menahem Begin: If he did not order marauding Israeli troops - at least two companies of infantry plus armored personnel carriers and "super-Sherman" tanks - back into Israel from southern Lebanon, Begin could not count on the good offices of the U.S. President.

Coupled with this warning, after months of Israeli defiance over Carter peace plans, was an only marginally less stern summons to Saudi Arabia: Persuade the Palestine Liberation Organization (PLO) to pull out of its Israeli border areas. As the PLO's chief subsidizer, the Saudis are powerful persuaders.

For Begin, the possibility of truly alienating the American President was, in the words of one Mideast expert, "a real and present danger." The implication sent Begin by top-secret diplomatic message through U.S. Ambassador Samuel W. Lewis was that the United States could not go on financing Israel's economy and security while Israel's army was on the loose in a neighboring country.

Adding to this pressure, Israeli Foreign Minister Moshe Dayan was bluntly told last week by a U.S. senator and loyal friend of Israel that Begin must stop his encroachment of the occupied West Bank. "I don't have to apologize for my credentials as a friend of Israel," Sen. Abraham Ribicoff told Dayan at a closed-door luncheon given by the Senate Foreign Relations Committee Sept. 20. Ribicoff then dropped this warning: More Israeli settlements on the West Bank might make it impossible for the United States to oppose a United Nations resolution that condemned Israel.

In similar vein, Dayan also got the full force of Carter's true feelings about southern Lebanon in his talks with the President last week. Dayan, who is regarded by some diplomats here as "flexible," undoubtedly informed the prime minister following those talks that, with Carter angry over Lebanon and the Senate unhappy over the settlements, Israel might consider a tactical retreat.

That retreat led to the ceasefire in southern Lebanon, but it would not have taken place without the President's stern pressure on Saudi Arabia - a more significant player in the Arab-Israeli struggle than generally realized.

With the Saudis, Carter's tack was the preservation in good health of the U.S.-Saudi Arabian alliance: Without Saudi muscle to move Palestinian guerrillas away from the Israeli border, the President would have trouble persuading Congress to approve the sale of F-15 fighter aircraft to Riyadh.

Putting the squeeze on the Saudis was, in its way, more delicate than squeezing Begin. The reason: By common consent here, the PLO guerrillas would have withdrawn from the border under arrangements agreed to earlier, but the provocation of Israel's mini-invasion changed their mind.

Such niceties of right and wrong played little part in Jimmy Carter's rising anger. The Saudis, by virtue of their tremendous wealth, were by far the most persuasive agents for dealing with the PLO. The value they place on their U.S. connection was reason enough to do as Carter asked.

What particularly marked the presidential handling of this crisis between the United States and Israel over southern Lebanon was its novelty: It was the first clear example that Carter may be mastering the technique of rapid, silent diplomatic movement made possible by American power exerted at the proper points in correct proportions.

Beyond that, it would be a mistake to make too much of the presidential maneuvers that forced Israel back from territories she has long coveted for both security and economic reasons. For one thing, not a single U.S. politician interceded in Israel's behalf: The legal case against her was too obvious.

More important, even though southern Lebanon could have exploded into Arab-Israeli peace conference. It was only one part of the tangled issues, most of them procedural, that must be straightened out before the Israelis and the Arabs can be brought together at Geneva.

Thus, although Carter played his secret hand brilliantly in this sideshow, the larger issues remain impenetrable and menacing: The role of the PLO, the unavoidable question of a Palestinian homeland and the Arab demand for full Israeli withdrawal from all Arab lands captured in 1967.