It is about 10 years now since a Republican administration barely beat back a congressional attempt to force the withdrawal of American troops from Western Europe. Now, pressure is building again in Congress, where a small but vocal group of lawmakers believes America's prosperous allies are not doing their fair share in the common defense.

Two days of hearings last week in the Senate Appropriations subcommittee on defense provided a glimpse of the emerging battle. It was neither a polite nor particularly well-informed debate. What it suggests is that, unless the administration doesn't want to defend its allies and its alliances, it had better pay more attention to the issue.

Three or four senators repeatedly hurled hostile and emotional questions at Pentagon officials called to testify. Anger and frustration at Japan and West Germany, as much over their business dealings as over their military efforts, hung in the air. At other times, blanket indictments of "the allies," without differentiating among them, were thrown around.

The Defense Department civilian and military witnesses--Deputy Secretary Frank C. Carlucci, Assistant Secretary Richard N. Perle, and Air Force Gen. William Y. Smith, deputy commander in Europe--responded timidly, without enthusiasm and frequently without information. In particular, the charges came from Assistant Majority Leader and subcommittee Chairman Ted Stevens (R-Alaska), who is the one threatening most vocally to bring the troops home.

The most well-reasoned and effective defense of the western alliances and suggestions for adapting to a changing situation came from outside witnesses such as Robert W. Komer, a former undersecretary of defense in the Carter administration; Jeffrey Record, a former aide to Sen. Sam Nunn (D-Ga.) who is with the Institute for Foreign Policy Analysis, and Leonard Sullivan, a Pentagon official during the Nixon-Ford years.

When Sen. J. Bennett Johnston (D-La.) portrayed NATO's northern flank in West Germany as weak and threatened, neither Perle nor the bank of military aides at his side pointed out that the United States moved a brigade into the north three years ago to strengthen that area.

When Stevens launched a thunderous attack on American plans to restation U.S. Army forces from old barracks in the southeast of Germany to positions closer to the border, nobody pointed out that the American Army to this day is mostly where it stopped at the end of World War II--living in old German barracks--and for all those years has been largely in the wrong place to meet a Soviet attack.

Stevens, who views West European participation in a natural gas pipeline project with the Soviet Union as tantamount to a West European sell-out and acquiesence to Moscow, charged that the West Germans didn't want to move their troops closer to the border because they do not want to offend Moscow. Then he asked why Americans should pay "to move U. S. troops closer to a border" the West Germans "don't want to defend."

Stevens' assessment was rebutted by Gen. Smith. But the fact that a senator in a key position would claim that West Germany--with the largest and probably the best armed forces in Western Europe--doesn't want to defend its own border suggests the tone of charges now seeping into the debate.

In a telephone interview after the hearings, Stevens also said another reason he wants to bring the GIs and the tanks back to this country is because the Russians might invade the American mainland across the Bering Strait and into his home state.

The focal point of Stevens' argument throughout the two days was that since 1975 the Pentagon, without calling congressional attention to it, has increased American forces in Europe by 58,000 troops, including 21,000 planned to go this year and next year, beyond the 337,000 already there. At the same time, Stevens alleged that the NATO allies had cut their forces by 56,000.

His point was clear: Why should the United States, which far outspends other allies on defense and is now faced with a severe budget crunch, keep adding troops while Europe cuts back? The Pentagon has slowly and steadily added troops to Europe, in part to restore those removed during the Vietnam war. Amazingly, however, the Pentagon officials, in two successive days of being hammered by the same statistics, were not able to give Stevens a clear answer.

As for Stevens' claim of the allied cutbacks, there was no attempt to differentiate as to which country had made such reductions. It was up to Komer, using a Pentagon report, to point out that the reductions were by Portugal, Italy and Britain and not by West Germany, which is the cornerstone of NATO defense and the country that most people tend to think of when the alliance is criticized. Germany, France and Turkey, which have the largest forces in Europe, all increased defense manpower during the 1975-81 period.

The hostility was also apparent in the questioning of Sen. Mark Andrews (R-N.D.), who claimed that the United States "had been played the patsy for too long" by a European Economic Community that had "sandbagged" every American effort to bring sanctions against Moscow for the Kremlin's actions in Afghanistan and Poland. "The American people," he said, "are getting sick and tired of defending them."

Carlucci's suggestion that the United States was defending its own interests in helping defend Europe fell like a whisper on the thunder coming from the panel.

It was Record who pointed out that it was tough to expect much from the Europeans while the Reagan administration continues to sell grain to Moscow.

On Japan, which spends less than 1 percent of its huge gross national product on defense, Sens. Warren Rudman (R-N.H.) and Johnston warned that a revolt was about to be "ignited" in Congress over Tokyo's stinginess in defense, although nobody pointed out that it was an American-dictated postwar constitution that limits Japan's defenses.

The frustrations in Congress and the dilemma for the Reagan administration are very real. The allies outspent the United States in relative terms on defense for most of the 1970s. But now the tables are turned, the economic situation is bad all over, and tempers are flaring.

Furthermore, the fact that Defense Secretary Caspar W. Weinberger, more than any other Pentagon chief in recent years, has given short shrift to the traditional American commitment to NATO in many official statements and emphasized a focus on flexibility and a globe-straddling Navy instead, has raised many suspicions in Congress that something has changed.

If that is not the case, however, then the Reagan administration is going to have to do a much better job of encouraging its allies to do more while convincing Congress not to throw out the alliance in a fit of pique.