HOW COULD IT have happened? How could Ronald Reagan, of all people, end up telling Ferdinand Marcos that he would have to give up the presidency of the Philippines to a group of rebellious military leaders and a woman who, 75 days ago, described herself as a housewife? How did Ferdinand Marcos, at the end of a lifelong relationship with America, find himself in a public confrontation with a conservative president who, he had thought, would be his best friend in the White House since Lyndon Johnson?

Should anyone take credit, other than the Philippine people? Did the U.S. finally learn something about dealing with dictators on the decline, or did we simply luck out?

The clearest thing that can be said about the Reagan policy is that, despite its occasional imprecision, it worked -- with perhaps a better outcome than in any similar crisis in postwar American history. Why? Several reasons are evident:

*In the Philippines, there was a democratic alternative to the traditional choice between the strongman and the radicals -- a key difference between the Philippines on one hand and Iran, Nicaragua and South Vietnam on the other.

*After a rocky start, our Philippines policy gathered bipartisan support, with a conservative president following an ultimately liberal policy while incorporating the symbolism and ideology of his own past. The Democrats not only supported Reagan but for the most part left him room to maneuver.

*The administration benefited from the relative uninvolvement of Reagan himself, which left his aides free to craft a policy that could respond quickly to events -- a foreign-policy approach that might best be described as "ad-hocism."

*As the end neared, there was a consensus within the administration, across ideological lines, that Marcos could no longer govern effectively. This consensus checked the usual inter-agency bickering.

*Marcos' fall came quickly, before the American right could regroup around an alternative to Marcos, or a catastrophe in Manila could produce second-guessing in Washington and the usual finger-pointing recriminations.

*Marcos self-destructed on American television, while Corazon Aquino, after a slow start, captured the imagination of the American public. Television increased the immediacy of the Philippines crisis in the United States and the sense that the U.S. had a stake in its outcome.

Aquino's victory, whatever the complex set of factors that produced it, is a significant gain for American interests. Though she is wholly untested as a leader of a government, President Aquino has a better chance to solve the pressing problems of the Philippines than did her predecessor.

For by the end, his early promise and brilliance were long-forgotten and his once-legendary force and dynamism were gone. The economy was falling apart and communist guerrillas were gaining a foothold in the countryside. It would be hard for Aquino to do worse.

Still, the Philippines remains a very sick nation. It would take miracles to turn around the rocky economic and political situation quickly, and not even Aquino, the devout, determined Catholic, promises miracles. But a bit of divine intervention may come her way in the form of the hierarchy of the Roman Catholic church. The church is a commanding force in this very Catholic country. In recent years, church leaders expressed open contempt for Marcos, and some priests even flirted with the communist guerrilla movement.

Now the church -- especially if it can work peacefully with the army -- can serve as the government's most powerful ally against the New People's Army, the communist guerrilla movement. The threat is serious. American intelligence agencies have warned that the NPA guerrillas could take over the country in three to five years.

Waiting around for miracles, of course, will not be enough. The United States played a critical role in the downfall of Marcos and the rise of Aquino. We cannot turn away from our responsibilities now, after linking our strategic interests so publicly to a democratic Philippines. Massive economic and military assistance must be offered to the Philippines, notwithstanding the grim reaper called Gramm-Rudman-Hollings.

Aquino's honeymoon with the Philippine and American people will not last forever. Real problems cannot be swept indefinitely aside on an endless wave of euphoria. But where there's romance, there's hope, and for at least the next few months the Philippine people may remain a nation in love, giving her at least a chance to turn things around.

The U.S., for a change, can share in the celebration. Finally, this country rode in tandem with an ally through its disintegration and came out on the side of the people and their wishes -- rather than trapped by history in a suicide pact with a leader who no longer had popular support. However reluctantly at certain stages, the U.S. ended up putting its policy where its rhetoric is, and emerged as a champion of democracy. Little wonder that in recent days, the administration has won rave reviews from everyone from Edward M. Kennedy to The Wall Street Journal.

Only a small band of people stand in silence, refusing to cheer the administration's performance -- far-right supporters of Marcos, and some once-proud practitioners of realpolitik who think the conflict between unbending support of old friends and the risky process of democratic change must always be resolved on the side of the old regime. These people are left defending to the bitter end every discredited old friend, from Somoza to the shah and now Marcos.

Many people -- haunted by the fall of Ngo Dinh Diem in South Vietnam in 1963, the shah and Somoza -- may recoil reflexively from the spectacle of a great nation disengaging from a beleaguered autocrat who once exchanged warm toasts at state banquets with American presidents. The acts and words that accompany such a shift in policy may leave a bitter taste in some mouths.

But in the Philippines the choice was between a friendly strongman and a potentially friendly movement seeking the revival of democracy. Given Marcos' long and close ties to the United States, it was inevitable that for some -- undoubtedly including Reagan -- the taste was bitter. But let's not be too sentimental: The fault for what happened lies with Marcos, whose behavior left Washington no other choice.

The evidence strongly suggests that the administration changed its policy not through a carefully thought-out process or any formal decision but as a result of a series of tactical decisions, often seemingly quite small, that were reactions to events in the Philippines. Although not every reaction was consistent with the others, they led inexorably to a simple, final position that Marcos had to go.

The man who had come to office attacking his predecessor for undermining Somoza and the shah did not want to have to tell Marcos to leave. Reagan no doubt hoped to the end that Marcos would reach that conclusion on his own without either private or, even worse, public advice from the administration. Yet in the end, when there was no other choice, Reagan did what he had to do, and what many people thought he would never do.

Of course, the central drama was played out in Manila, and it was the Philippine people themselves who brought Marcos down. But it was actions and statements by top American officials that turned the tide finally and irrevocably against Marcos.

Some critics have charged that the Reagan Administration moved too slowly, especially in the early stages, in making clear where it stood; these critics argue now that we were lucky that things didn't turn out badly, given official ambivalence over Marcos. There is probably some truth to this view, but after a policy success of these dimensions, such considerations seem trivial.

What was critical to the success of the policy was its extraordinary degree of bipartisan support. It is doubtful if conservatives would have supported a Democratic president following similar policies, and in that sense it was clearly easier for a Republican to do what had to be done than it would have been for a Democrat.

Key Democrats like Stephen J. Solarz (N.Y.), chairman of the House foreign affairs subcommittee on East Asian Affairs, and John Murtha (Pa.), co-chairman of the election observer group, worked closely with men like Sen. Richard Lugar (R-Ind.), chairman of the Senate Foreign Relations Committee and leader of the observer group. Majority Leader Bob Dole (R-Kan.) and Democrat Sam Nunn (D-Ga.) made parallel statements that made clear to Manila and the White House alike that on this issue, the Congress was going to speak with a single voice. Lugar also worked closely with Secretary of State George Shultz, who played a masterful role in guiding policy.

There are precious few recent examples of such bipartisanship on a major foreign policy issue. But it had clear value: The absence of a bitter public debate over policy greatly strengthened the impact of the American role in Manila. Filipinos on both sides constantly looked to Washington for signals. Had these remained mixed, as they did briefly just after the Philippine election, it might have sent Manila a dangerously confused message.

Lugar's role was important in establishing a consensus that the election itself had been a sham, but it was his fellow Republican, Paul Laxalt of Nevada, who played the most complicated role.

Although a member of the U.S. Senate, Laxalt really functioned as a member of the executive branch on a special mission for his close friend, the president. It is not clear what he, or, for that matter, the president thought Laxalt was doing during his trip to Manila last year, but the practical effect of his trip was to remove bureaucratic barriers between Presidents Reagan and Marcos and sharply increase the pressure on Marcos.

Laxalt did not tell Marcos to consider leaving; all he thought he was doing was telling Marcos to reform. But to know Marcos was to know that reform for a strongman in his 20th year in power was an impossibility. He would either continue his old ways, or he would leave. Marcos now made his fatal mistake and called for an election. Did he think that this would satisfy Reagan and Laxalt? Did he believe he could really win an honest vote? Did Laxalt suggest it or indicate his approval of the idea? These are among the most important remaining unanswered questions about the events of the last year.

Whether or not Laxalt encouraged Marcos to call the special election, it is clear that the election was a direct response to the pressures Marcos felt were building up following the Laxalt mission. Near the end of a lifelong relationship with America -- a nation he admires deeply but doesn't understand, a nation he wishes would love him but which never has -- Marcos offered America a bizarre parody of our own presidential elections, thinking, apparently, that it would please and satisfy us. But his imitation of America, like so many other aspects of the Marcos style, ignored the consequences of trying to imitate us.

Marcos did not understand that this election, unlike several other legislative elections he had conducted for similar reasons in recent years, would be different -- by virtue of the growing concern in Washington over the NPA and Marcos' health, and because of the unresolved legacy of Ninoy Aquino's death. Marcos did not understand that this election was destined to be a referendum on dictatorship versus democracy. His miscalculation became complete when Corazan Aquino's candidacy unleashed the pent-up passions of the Philippine people and turned a campaign into a crusade.

Reagan may have also miscalculated the effect of Marcos' decision to call the election. It is doubtful that he understood fully what surely occured to his advisers at the State Department: That the election itself would reduce Reagan's options. Without an election, the press and liberal critics could bash him and Marcos all they wanted to, but the choice would still have appeared to be between an old friend and the unknown.

Now, suddenly, it became a real choice, and for Reagan, a real dilemma. The election in Manila took on a clear symbolic power, and Ronald Reagan understands symbols. He had to declare, as he did well before the election, that we would insist on a fair and honest vote. Any other position would have undercut his global rhetoric about spreading freedom and democracy.

The decision to send the Lugar-Murtha observer mission then followed, again not without some internal arguments. It was another critical milepost on the road to revolution, because Lugar and Murtha legitimized the press reporting of massive fraud and made it impossible for those, like White House chief of staff Donald Regan, who may have wanted to look the other way. Once he had seen the fraud firsthand, Lugar, a man of impeccable conservative credentials, had either to oppose Marcos or become an accomplice in the cheating.

Within the executive branch, those who knew the region had concluded that the time had come to try to get Marcos out. They were not liberals, as charged in a few newspaper columns, but professionals, including the chairman of the Joint Chiefs of Staff, Adm. William J. Crowe Jr., who felt that if Marcos survived this challenge, the only beneficiary over time would be the communists. They too made common cause with Lugar, and they had the strong support of Shultz.

The policy was now closing in on Reagan, just as events were closing in on Marcos. Reagan may have hoped to keep out of the whole mess, but once the voting was over and the world had judged it fraudulent, he couldn't stay clear. His first forays onto the public record were confused and almost disastrous, but they revealed how deeply he wanted to avoid having to tilt against Marcos. How much cleaner it would be, he undoubtedly hoped, if Marcos could just reach the right conclusions on his own. Perhaps to encourage that process, he sent still another special emissary, Philip Habib, to Manila, with deliberately vague instructions.

But despite all Reagan's efforts to avoid a personal involvement, despite all the skill shown by men like Habib and Lugar, Ambassador Stephen Bosworth in Manila and Undersecretary of State Michael Armacost, in the end it came down to this: Marcos would not leave his palace-turned-bunker until he understood clearly that it was the American president's personal belief that he should do so. The colonial legacy was still alive and had served, for once, a useful purpose.

In the end, the policy worked because it succeeded, not because it was right. But such tautologies have limited value for those seeking guidelines for the next crisis. Could we succeed in other countries with similar involvements?

The answer, unfortunately, is the diplomat's delight but frustrating for the rest of us. Each country is different. American interests and potential influence are different in each country. What works in Manila will not work automatically in, for example, Seoul, where a different tradition and history are at work.

Everyone loves to cheer a winner and this time we have both Ronald Reagan and Corazon Aquino to applaud. And it will perhaps be Reagan's good fortune, once again, that by the time the Philippines' endemic problems of poverty and communist insurgency next dominate the headlines, Aquino -- but not Ronald Reagan -- will have to face them. For better or worse, America's role in our former colony is not over.