Four years ago, an obscure black politician won a victory that seemed to exemplify American democracy at work.

Margaret Morton was elected to the state senate by an eight-vote margin after a major campaign to add new voters, many of them black and poor, to the rolls. They made it possible for her to beat the machine.

But voter registration cuts both ways. Masses of new voters can represent a threat to the established political order, whether Democrats or Republicans are in control, and can lead to new efforts to make the registration process as difficult as possible.

The struggle Morton set in motion here in 1980, forcing the politics of voter registration to the surface and dividing Democrats by pitting blacks and Hispanics against Italians and Irish, is reflected in battles nationally in this presidential election year.

From Chicago to Arkansas, from Missouri to Pennsylvania, organizations representing blacks, Hispanics and the poor are complaining that state and local political leaders of both parties are trying to keep registration down--and them out.

Project Vote--which specializes in registering poor people on unemployment lines, in welfare offices and in food distribution centers--has filed suit in Ohio, Pennsylvania, Indiana and Missouri to gain access to those public facilities. All four states had Republican governors at the time.

Within the past two weeks, the NAACP Legal Defense Fund has gone to court charging unconstitutional, discriminatory registration practices in Mississippi and Georgia. Those states are governed by Democrats.

Additional legal challenges to registration procedures are being prepared in Michigan, Louisiana, Arkansas, Florida, New Hampshire and Virginia.

At issue are such practices as requiring prospective voters to travel as far as 50 miles to register, selective "purges" of voter rolls by political appointees and the refusal to appoint deputy registrars to sign up voters in their homes or in such public places as schools and recreation centers.

For Democrats, in particular, the struggles over voter registration pose a political dilemma.

Nationally, Democrats are engaged in a massive effort to register millions of new voters this year. They know that their chances of defeating President Reagan in November depend upon mobilizing and turning out new voters.

Yet they also know that registration drives can cause deep divisions--and defeat--by setting economic group against economic group and race against race. Inevitably, the group in power battles to retain control. Building new barriers to registration often becomes the price of maintaining political control.

That's what has happened in Bridgeport. Beyond the 'Locks'

It's an old story to politicians in this city, which traditionally has been solidly Democratic but recently has seen Republicans capitalize on Democratic divisions by twice electing a GOP mayor.

"The history was to keep the enrollment down to those individuals you knew, your so-called 'locks,' " said Tom Bucci, a rare commodity in Bridgeport politics: an Italian-American and liberal Democrat who is expected to run for mayor next year.

"Those are your votes, your 'locks,' the people you've got a lock on. That was the old traditional Democratic politics for a generation or two: keep the rolls limited to the individuals you can pick up on the phone and call. It was a closed political system. If you keep control over those on the voting rolls, you don't have to worry about control of the party."

Fear of losing control touched off the struggle in the Morton race, which still reverberates throughout this racially polarized industrial seaport.

No one here knew what was beginning when Morton declared her candidacy for the state senate in 1980. She was then a state representative and loyal member of Bridgeport's Democratic machine.

The incumbent, Salvatore DiPiano, had announced he was retiring. So Morton proclaimed her right to his seat on the basis of her years of service to the city's Democratic organization, run with an iron hand by Mayor John Mandanici.

Instead of retiring, however, DiPiano abruptly reversed himself. He sought reelection, and won the full backing of the Mandanici organization.

Morton did not back off, even though it was widely assumed that running against the machine would be futile.

Under Connecticut law, Democratic and Republican registrars of voters are given discretionary power to appoint deputy registrars. Here, Mandanici made a major miscalculation. Although he controlled the Democratic appointee, he permitted the deputization of registrars supporting Morton.

Newly deputized registrars combed the city's housing projects and black neighborhoods. On Election Day, the registration drive paid off. Morton beat DiPiano by eight votes, 2,888 to 2,880.

The Mandanici machine did not make that mistake again: there would be no more deputization of registrars. Electing Out a Mayor

The battle lines between the Italian and black communities had been drawn, however. The next year the boss himself, Mandanici, was up for reelection. His Democratic primary opponent was Charles Tisdale, a black.

In a bitter primary contest, Mandanici barely beat back Tisdale's challenge. Later, he refused to make peace with Tisdale through a deal involving housing construction in return for an endorsement from black leaders.

That was Mandanici's second major miscalculation. Just as blacks had turned out in numbers for Morton, they sat on their hands during the general election rather than vote for Mandanici. While blacks nationally have been voting Democratic by 9 to 1, the few blacks who went to the polls in Bridgeport in 1981 split evenly between Mandanici and the Republican mayoral nominee, Leonard Paoletta. In the heavily black 139th District, Paoletta, a conservative Reagan supporter, beat Mandanici by 109 votes, 984 to 875.

As it turned out, those were just enough to beat the seemingly invincible Democratic boss. Paoletta won by 103 votes, 17,941 to 17,838. This Republican victory was achieved in a city where, in 1980, Democrats outnumbered Republicans by nearly 2 1/2 to 1 (25,418 to 10,955), and where 19 of 20 members of the Bridgeport Common Council were Democrats.

"I was not so much elected in 1981 as the incumbent was thrown out," Paoletta said. "He got elected out, I didn't get elected in."

Two years later, in 1983, the Democratic Party in Bridgeport discovered a new way to lose. That year, Tisdale won the Democratic nomination, beating Mandanici in the primary. But Mandanici engineered a third-party nomination on the ticket of the Taxpayer's Party.

The general election turnout set records. Tisdale got 15,096 votes and Mandanici 10,095. But Paoletta squeaked out a second victory with 16,129 votes. In the 139th District, which had cast only 1,859 votes in 1981, the turnout shot up to 3,117, with 2,620 going to Tisdale. A New Political Cause

The bitter struggle over registration and turnout in Bridgeport has ramifications that go beyond the tearing apart of a once-strong Democratic Party, and beyond the election of a GOP mayor and eight Republicans to the city's 20-member Common Council.

Two other elements have broad, national significance in this presidential election year.

Restrictive registration practices may, in fact, provide blacks and the liberal wing of the Democratic Party with a strong incentive to put people on the rolls. The practices give them a political cause to fight.

Registration involves a battle for power within Democratic ranks as well as between the two major political parties.

This year has seen the emergence of a new kind of alliance that adopts registration as a key mobilizing tool politically. Across the nation, liberal to radical organizations are attempting to make barriers to registration the political cause of the 1980s.

"I think we are creating the impression that this is something that could be very big, and there is talk about a movement comparable to 1964-65 around registration," said Hulbert James, president of the Human Serve Fund, a drive similar to Project Vote seeking to register the poor at government facilities.

A week and a half ago, these two groups, along with such organizations as the Association of Community Organizations for Reform Now (ACORN), the National Organization for Women (NOW), the American Civil Liberties Union, the NAACP Legal Defense Fund and Americans for Democratic Action, declared "a national voting rights emergency" as part of an effort to boost the general registration drive. Shifting the Balance

It is not clear whether voter registration will gain anything like the status or momentum of the civil rights movement two decades ago. Here in Bridgeport, though, there is strong evidence that registration drives can shift the balance of political power.

From June, 1980, to this month, voter rolls in Bridgeport grew by 4,511, from 56,730 to 61,241.

More significantly, the battles over the mayoral seat have produced a massive increase in Democratic registration.

In the last four years, Democratic registration has shot from 25,418 to 36,022. That's an increase of 10,604, or 42 percent. In the same period, Republican registration dropped slightly, from 10,955 to 10,270, while independents decreased sharply, from 20,357 to 14,949.

Everyone from Tisdale to Paoletta agrees that the overwhelming majority of new registrants are blacks and Hispanics. All also agree that the Democrats' internal disputes, pitting factions against each other, have helped the party gain new eligible voters by getting independents to switch to the Democratic column.

Growth in Bridgeport's Democratic Party has been explosive, but it also has produced a political paradox. It has not resulted in victory.

In this, Bridgeport's experience mirrors that of the Democratic Party nationally. Bridgeport remains severely divided along racial, economic and ideological lines. Democrats nationally confront those same fissures. A Party Divided

The politics of voter registration is marked by intense conflict.

"Voter registration helps the left," David Glaser, of the Bridgeport ACORN project, said. "The people who don't vote in this country are on the left . . . . "

James, of the Human Serve Fund, said much the same thing: "If you can expand the base of the Democratic Party, with people who are presently left out, you can substantially change the party to the left."

Conversely, John Guman Jr., the conservative but highly pragmatic chairman of the Bridgeport Democratic Party, sees his party classically divided:

"The Democratic Party has polarized itself, more and more making itself the party of the minorities and the liberals, without realizing that the people who have been longtime Democrats--the blue-collar workers, the white-collar workers, whose fathers were Democrats--their philosophy no longer jibes with the Democratic Party.

"We are losing them . . . . A lot of whites, who started working in the factories, now they are more affluent. They've got a home, two cars, tuition to pay. They are saying: 'Well, Jesus, the Democratic Party is getting more and more liberal. How is that going to benefit me?' "

Guman, however, personifies the ambivalent and conflicting forces within the Democratic Party. While he attacks what he sees as a shift to the left, he has been negotiating a compromise with the Bridgeport registrar's office that appears likely to result in some deputization of registrars.

Blacks and such groups as ACORN and NOW "are registering Democrats, that's all I care about. I won't subscribe to everything that ACORN and NOW subscribe to, but, by bringing them in and making them part of the organization, you work to a position where maybe you'll be able to compromise," he said.

"Listen, that's what the game is all about: you go out and register your people and then do the best you can. That's how everybody did it to get a piece of the pie."

For Guman, the Democrats' loss of the mayor's office has been particularly painful. It also meant losing 300 to 600 patronage jobs normally channeled through the party. "There are a lot of hungry Democrats out there," he said.

With some relish, Paoletta, the Republican mayor, contended that Guman's goal of a united Democratic Party may not be on the horizon.

The Democrats "are in for a long, drawn-out battle for a long time to come," he said. "It's something they are going to have to live through."

Paoletta, who sees old-guard, white Democrats as a potential source of support for the GOP--and a major source of backing for his own election in 1983--contended:

"White Democrats are going to wake up and realize that they may be knocked out of the ball game, and you'll have blacks and Hispanics running the Democratic Party . . . . Any numbers that Republicans get are going to be all white at this stage."

That outcome by no means is ordained. Recalling a Dictum

For Democrats, Bridgeport's experience with the new highly charged politics of voter registration teaches several hard lessons.

Here, the clash among competing ethnic, racial and economic groups, between the ins and the outs, has been destructive. Efforts to maintain the old political status quo by erecting new barriers to voter registration have resulted in Democratic defeat at the polls.

At the same time, these same struggles over increasing the voter rolls have added greatly to the party's potential strength. Thousands of new voters have been enfranchised. They represent the balance of power in the future.

Despite all the bitterness of the recent political battles, there are signs that Democrats are relearning one of the oldest dictums of party politics: the art of politics is the art of compromise. To taste the plums of victory, one must be willing to give.

Acting out of that kind of basic self-interest, key Democrats are attempting to put together a classic political compromise. If successful, it will enable them all to share power in the end.

Guman, whose ties are to the old guard, struggles to take the edge off the divisive Democratic factional disputes. His aim is to ensure that whoever receives the party's mayoral nomination next year will be backed at least nominally by all Democratic leaders, whether blacks, whites or Hispanics.

"I'll try to put the whole thing together, pick the candidate I think can win, the candidate with the best chance of winning," he said. "The party is changing . . . . We are going to have to live through it."

Black and liberal opposing groups express satisfaction with the compromise Guman is trying to reach on expanding voter-registration activities.

If it works, that kind of approach represents the path to victory for Democrats in Bridgeport and across the nation. If not, the words of Bridgeport's Republican mayor hold a warning for Democrats everywhere: "Bedrock, fairly conservative Democrats are going to say, 'That's not my party anymore.' "