The District's primary election yesterday offered a tale of two parties at vastly different stages in their development.

For the Democrats, the election was a celebration and affirmation of a powerful alliance between Mayor Marion Barry and key Democratic members of the City Council. But for the Republicans, a pipsqueak force in overwhelmingly Democratic Washington, the election signaled a yearning for a new and stronger voice on the council.

Republican Carol Schwartz defeated 66-year-old council member Jerry A. Moore Jr. (R-At-Large), a 15-year veteran who was closely allied with Barry and the council's Democratic majority. Schwartz, 40, an outspoken former school board member, argued that the public was "begging" for a new champion on the council who would oppose increases in taxes, demand that potholes be fixed, and generally force the Democrats to toe the line.

Margaret Khosrofian, an elderly resident of Ward 3, summed up this feeling as she left a polling place at the Lafayette School on Broad Branch Road yesterday: "We need a change. Everything is the same and getting worse for me. We need a young and active person."

A breakdown of the vote by wards showed that while Schwartz and Moore each carried four wards, Schwartz carried the wards with the most registered Republicans.

In addition to winning Wards 1, 2 and 6, Schwartz carried Ward 3, a largely upper class and mostly white area that has 7,740 registered Republicans. In the 1980 primary, Moore said: "You have to do well in Ward 3 to win," and yesterday, 47 percent of the Republican vote was in Ward 3. Moore carried Wards 4, 5, 7 and 8.

Moore, a Baptist minister and chairman of the council's transportation committee, for years justified his collaboration with the Democrats as essential to getting things done in the city. Ironically, the extraordinary endorsements he received this year from Barry and eight council Democrats may have helped to seal his political fate.

But the mayor's endorsement had just the opposite effect in the Democratic column, where incumbents Charlene Drew Jarvis (D-Ward 4) and Wilhelmina J. Rolark (D-Ward 8), with the aid of the mayor's political organization, easily fended off vigorous challenges from two well-known and controversial school board members.

Council members John A. Wilson (D-Ward 2), H.R. Crawford (D-Ward 7) and John L. Ray (D-At-Large) also rolled to victory in the primary. Wilson ran unopposed.

Barry spent part of the day in his chauffeured limousine moving back and forth between Ward 4, in Northwest and Northeast Washington, and Ward 8, east of the Anacostia River, making sure his workers were manning the precincts and turning out the vote for Jarvis and Rolark.

"We've got a strong organization out there and I want to see how it's working," Barry said during one stop at the La Salle School, near Riggs Road and Madison Street NE.

Jarvis and Rolark, both of whom were criticized during the campaign as being unresponsive and losing touch with their constituents, may have been helped as well by the voters' rejection of the confrontational and abrasive style of their two opponents, school board members Barbara Lett Simmons (At-Large) and R. Calvin Lockridge (Ward 8).

Kathy Rinzel, an unemployed resident of Ward 4, said she voted for Jarvis largely because she was "turned off" by Simmons' efforts to "exploit the fears and concerns" of residents about the relatively large number of group homes in the area.

"I'm not a wild supporter of Jarvis, but I thought Simmons was very divisive on the school board," Rinzel added.

The AFL-CIO Metropolitan Washington Council, which only recently has begun to show signs of political potency and which endorsed all of the incumbents, may have been another winner yesterday.

In the Ward 4 race, the AFL-CIO group reluctantly endorsed Jarvis while a rival organization, the Food and Allied Service Trades Council (FAST), supported Simmons.

Jarvis' resounding 3-to-1 victory was even more remarkable in light of Jesse L. Jackson's last-minute show of support for Simmons at a gospel concert Friday.

Jarvis riled some of her black constituents by campaigning for Walter F. Mondale rather than Jackson during the Democratic presidential primary. Barry had to do a lot of last-minute coaxing to keep his Ward 4 supporters in line behind Jarvis.

Jarvis, who challenged Barry in the 1982 Democratic mayoral primary but now is among his closest allies on the council, pooh-poohed the significance of Jackson's role in the outcome of her race.

"The voters made a decision between what were primarily local issues and issues that were national," Jarvis said. She also called Jackson a "closet Republican" for taking precious time out from campaigning for Mondale to enter a local race.