President Reagan is being denied, in some quarters, personal credit for arranging the American part of the Marcos-to-Aquino transition. It's said that his Philippine policy succeeded despite him; aides conducted it behind his back. His evident readiness at one point to go with President Marcos, on grounds that both sides had cheated and the opposition had survived to fight another day, is cited as the clincher.

It seems to me only fair, however, to give Reagan the lion's share of what lesser credit should flow to the American government after the Filipinos are acknowledged as their own true redeemers. The evidence is that he was in control of the policy from the start. And he traversed an awesome political distance in order to occupy the position he finally held.

For the liberals, the Philippines was always an easy case. Marcos was a tyrant who had hoked up a communist threat and hijacked a democracy, and he should somehow be removed: it was nearly as simple as that.

For conservatives, however, it was always a hard case. Marcos seemed the very model of the authoritarian ruler who, for all his flaws, needed to be indulged because he was a strategic asset to the United States and represented something superior to the worst-case but not implausible alternative of a leftist takeover.

His country had long provided crucial bases. He had supported America's most trying postwar Asian enterprise, the Vietnam war. At the end he had lost proportion, but over the years he had given what most Americans considered good value: Jimmy Carter, after all, renewed the bases.

Reagan had hanging over him, too, the specter of the sharp leftward turn of Nicaragua and the fundamentalist orgy of Iran following what turned out to be failing Carter efforts to locate a center that would hold. These were efforts that Reagan and many supporters had denounced as destabilizing.

Nonetheless, he set aside his natural hesitations and formally adopted -- keep in mind, in 1984 -- the interventionist policy of trying to save the Philippines from Ferdinand Marcos. Only once, on that single day after the elections, was he to wobble conspicuously. To the very end Marcos desperately probed to find some political space between Reagan and members of his administration, and found none.

No wonder that, as a Reagan aide said this week, the president's pleasure in the Philippines' peaceful passage was tinged by sadness at what had happened to Marcos. It would have been weak and wrong to have let American policy be guided by this sentiment, but to have felt it and subdued it adds a becoming human dimension.

Thus did a deeply anticommunist president -- incredibly, for the second time in as many weeks, counting Haiti -- end up traordinary position of helping to bring down a friendly, avowedly anticommunist government.

We are getting a better idea of how Reagan arrived at what is far and away his finest diplomatic hour in five-plus years -- this, oddly, just as he had finished staging a flat and forced celebration of what he regards as its finest military hour, the Grenada invasion of 1983:

*Because of the unique historical relationship of the two countries, the United States had the multi-channeled access to Philippine politicians and people that allowed it to bring timely influence to bear.

*The Philippines is a developed and politically mature enough country to have produced a democratic opposition that even the most skeptical Americans were ready to bet on by the time Marcos had provided a televised lesson in electoral fraud.

*The communist guerrillas and their civilian comrades sat out the elections, leaving Corazon Aquino to win without accumulating any debt to the men with the guns and leaving them shorn of their principal target, the "U.S.-Marcos dictatorship."

*The administration had its act together.

The lesson Reagan finally learned, and taught, is that there need be no contradiction between advancing democracy and resisting communism. To think of one as the exclusive task of liberals and the other of conservatives makes little sense. The Philippines was one place -- not a typical place but not a singular place either -- where the two goals had to be pursued in tandem.

What the Filipinos did for themselves, with a little help from their American friends, was to buy a bit of time to deal with a dire national rot. Now comes the hard part: making Philippine democracy work.