RALPH BARGER ought to be a Democrat. His family comes from a Democratic state, Oklahoma, and as a young man he followed his father into a Democratic trade, photo-engraving and a Democratic labor union.

Today, at 51, Barger is the owner of a couple of printing businesses, the mayor of Wheaton, Ill. -- and a staunch Republican. He recently endorsed John Connelly for president, mostly because he thought Philip Crane, despite his admirable views, was not electable.

On the other hand, Kathleen Barber ought to be a Republican. She comes from a Republican town, Columbus, Ohio, is married to a well-to-do businessman, and lives in the affluent Cleveland suburb of Shaker Heights, in a house that is just barely this side of being a mansion. But she is the Democratic vice mayor of her town and a fervent liberal -- because, as she explains it, "liberals tend to think public is better than private and that a lot of our problems are due to private greed."

These misbehaving people live in two congressional districts that, as a whole, are of mystifyingly different political persuasions. One is the 14th of Illinois -- overwhelmingly white, affluent, mostly white collar, in the suburbs west of Chicago. The other is the 22nd of Ohio -- ditto, except that it's in the suburbs east of Cleveland. If simple economics makes people vote the way they do, the two districts should vote the same way.

But the 14th of Illinois is as reliably Republican a district as there is in the country, and the 22nd of Ohio is solidly Democratic. The Illinois district gave Gerald Ford 71 percent of its vote in the last presidential election, and regularly turns out even bigger margins than that for its conservative eight-term congressman, John Erlenborn. The Ohio district has been represented since 1968 by Charles Vanik, one of the House's staunchest liberal Democrats, who in recent elections has won with more than 75 percent of the vote. The 22nd sent Udall delegates to the 1976 Democratic national convention and went for Jimmy Carter in the election.

Why the difference? To use a word much out of favor in explaining political behavior these days, it's a matter of ideology. Regardless of the candidates' personalities, organizations, strategies, use of the media, or any of the other factors to which state and national election results are usually chalked up, the districts tend to stick with separate parties. In local elections they're not so totally loyal to party, so it follows that in national politics their real loyalty is to two different sets of ideas about politics and government.

Of course, how much money people have is one important source of their ideas -- but, as our two districts show, it's not the only source. It used to be widely assumed that as the country became more prosperous and more suburban, it would also become more Republican. "The Democratic Party," Robert Taft declared in 1952, "will never win another national election until it solves the problem of the suburbs." In fact, in the years since then America has become more Democratic, and polls show the Democrats having more strength among people under 35 than people over 35. What makes people Democrats or Republicans -- and liberals or conservatives -- has to do also with their ethnic background, with the culture of the place where they live, and even with their vision of America.

The conserative 14th district of Illinois takes up 8 1/2 of the nine townships in DuPage County, 30 miles west of Chicago, a formerly rural area whose old towns have been engulfed by brand-new subdivisions, shopping malls and apartment complexes. The district is now mostly '60s and '70s suburbia.

The liberal 22nd district of Ohio is obviously older, the product of the boom that took place in the 10 years following World War II. It is closer to town -- just east of the Cleveland city limits -- and full of 30-year-old houses, delicatessens and Eastern European restaurants. Its new apartment houses are senior citizens' homes. The median age in the district is 31.5, as against 26.2 in the Illinois district. In the Illinois district, there are 55,000 homes built in the '60s; in the Ohio district, only 38,000.

Each district has, during its boom period, taken in thousands of born Democrats -- ethnics from the Democratic wards of the cities. In the Ohio district, they retained a strong sense of ethnic identity and unseated a Republican political establishment. In the Illnois district they became assimilated into Republicanism, through the strength of the DuPage County Republican organization and the appeal, in that setting, of Republican ideology.

There was a time in DuPage, when Republicanism looked endangered. One day in the mid-'60s Joanne Maxwell, longtime head of Rep. Erlenborn's DuPage County office, was taking one of her periodic driving tours of the district with a friend. "I remember we got to Glendale Heights," she says now; Glendale Heights is the district's newest town, with a medium age of 17.3 "And I turned to my friend and said, 'I haven't seen a Republican face in 20 minutes.'" You just knew those people weren't Republicans." And they weren't -- but they vote Republican today.

One reason they do is that Republicanism was practically the only route to political enfranchisement, and another is that, as has been the case since the Progressive era, for people in the suburbs Democratic politics was strongly identified with a much-hated city machine, in this case Richard Daley's in Chicago. It was mainly those reasons that prompted Patrick Durante, for instance, to make the switch. Durante, 39, is a salesman who grew up in an Italian Catholic neighborhood in a ward on Chicago's West Side that votes 95 percent Democratic. His parents were Democrats -- and he is today Republican chairman of Addison Township, in the northest corner of DuPage County.

"I first became a Republican in 1959," says Durante. "I wanted to be a cop because in my neighborhood you either became a cop or a crook. I wanted to be a deputy sheriff here in DuPage. The county chairman said I couldn't get a job because I wasn't a registered Republican. cSo I registered Republican, and I still couldn't get the job.

"But I didn't become a real Republican until 1965, when I opened a tire store on the West Side of Chicago. That's when I knew I had to do something. Everything broke loose. The building inspector showed up. The electrical inspector. The ventilation inspector. The driveway inspector. Once you gave money to one of them, you became a mark. These guys might come by once a month. Say it was the electrical inspector. If he just mentioned an outlet, that meant he wanted $5. If it was rewiring, that was $25. After that, I just wanted to defeat the Democrat Party and everything it stood for. It wasn't like that out here. You didn't have to pay anyone.

Now Durante is engaged in bearing the torch himself, going to see the new wave of people moving to DuPage from Chicago and trying to convince them of the righteousness of Republicanism. "First I tell them, 'You're in the a Republican area now and the way we do it is vote Republican,'" he says. "That works with 7 out of 10.

"With the rest, you sit in the living room and talk philosophy. You say, 'If even an inspector comes to you wanting money, call me and they'll be fired, indicted and prosecuted. We've got a good clean county and we want to keep it clean. So you've got cleanliness in government. We don't take federal money. We pay as we go.' That's the soundest argument I can use. And it's true."

In broader outline, the Republican Party is thought of in DuPage as the repository of national, as well as local virtue, and as the countervailing force to the evil and wasteful federal government.

Erlenborn's private polling of the district bears that out. In 1978, to the question, "Would you agree to a curtailment of government programs to reduce or eliminate deficit spending?", 92 percent answered yes. Asked in 1977, "Which course do you prefer?", 79 percent picked market forces. Other institutions lacking a stated dedication to the primacy of the individual are also unpopular. Another of Erlenborn's polls asked, "Would the endorsement of a candidate for a county-wide office by a labor union make you more or less likely to vote for that candidate?" The result was 10.3 percent more, 42.6 percent less. "We don't even have to say Democratic anymore," says Joanne Maxwell. "We just say big labor."

The district has several big technological research plants -- including Bell and Fermi Labs -- that get federal contracts, but its vision of itself is as an area that stands on its own feet and doesn't take federal money. When practicality triumphs over principle and DuPage tries to get federal grants, the results always seem to be bitter.

"In liberal politics," Mayor Ralph Barger of Wheaton explains, "you run into exercises of intellectualism. They discuss a problem, they come up with an answer. But the answer might be questionable. Very seldom do they look and see if it does harm. That's what I don't like about the Ted Kennedys and the HUDs. Many people who indulge in politics are just doing it as an intellectual exercise. Lenin was in that ilk. Castro was a school teacher." As they tell it, the people of DuPage County solve their problems through a reverence for sound business practices and an insistence on doing things on (and this is a phrase that stirs souls there) the local level.

Accurate or not, these ideas fit well into the way people who move to DuPage like to think of themselves. So all the in-migration -- the county has grown from about 150,000 people in 1940 to about 600,000 today -- has had only a tiny political impact. In 1974 the Democratic Party reached its high-water mark when it won four of the 25 seats on the county board; today it has only one. The leading social-protest group in the county is a secretive organization called TAPROOT. That stands for Traditions and Principles Republicans Often Overlook Today, and its members keep vigilant guard against, as one of them puts it, "9-to-5 liberals."

In the 22nd district of Ohio, when the people from the city moved in, they kept their Democratic politics and their friendly feelings toward Cleveland. Their favorite villains, rather than the federal government and the city machine, are big business and the city commercial establishment. As the in-migration tailed off in the '60s, the district changed from Republican to Democratic. If you have to pinpoint one reason why the ethnics changed this district's politics and not the Illinois district's, it would be that there are more of them, and that they settled in ethnic neighborhoods and kept a sense of non-suburban identity.

For years, shaker Heights was the district's richest and most Republican town. Through the '40s, the Cleveland real estate company that developed Shaker Heights had kept tight deed restrictions governing everything from lot size and home design to the race and religion of the residents. In 1948 the supreme Court outlawed such restrictions. That, combined with new money the postwar boom brought to many people, caused the migration of ethnics from the East Side of Cleveland -- mainly Jews, later blacks -- into Shaker Heights and the surrounding communities. By the mid-'60s, Shaker Heights was about a third Jewish; Beechwood and University Heights, mostly Jewish; Cleveland Heights, a third Jewish.

At the other end of the district, along the industrial shoreline of Lake Erie, towns like Euclid were already heavily ethnic (Italian, Slovenian, Ukranian) and blue-collar, and their traditional allegiance to the Republican Party had softened considerably. Lake County, in the northeast end of the district, elected its first Democratic officials in 1958. nIn 1964 Lyndon Johnson carried the district. In 1968, following a redistricting, Charles Vanik, who had represented part of the city of Cleveland for 14 years, ran in the 22nd against the 82-year-old, 14-term Republican incumbent, Frances Bolton, and beat her. In 1970 a Shaker Heights Democrat, Harry Lehman, won a seat in the legislature. In 1971, Shaker Heights elected a majority-Democratic city government. In 1976 Euclid elected its first Democratic mayor.

Today, Shaker Heights is liberal enough to have a voluntary busing system in its elementary and junior high schools, for which there is a waiting list of white parents. Shaker, University Heights and Cleveland Heights have voluntary "neighborhood stabilization" programs that aim to move whites into black neighborhoods. Over in Beechwood, a prominent liberal rabbi, Arthur J. Lelyveld, presides over the third-largest Jewish congregation in the country. "Most of our people have been living in the suburbs for 20 years," says Lelyveld. "But they've kept a strong dedication to Jewish values.Our movement, the reform Jewish movement, has always put a strong emphasis on social activism. The whole thrust of our tradition is a concern for social welfare."

With the same fierceness that DuPage County considers itself completely divorced from the federal government, the 22nd district, whose fanciest neighborhoods are far beyond anything you'd find in DuPage, considers itself divorced from business. "Free enterprise?" says Mary Boyle, the first-term Democratic state representative from Cleveland Heights. "It's been an eye-opener for me to be in the legislature and see how much that's an issue. I have one constituent who writes me about that."

Having gone through the sensible reasons for the two districts' different political and ideological affiliations, it's worth poking briefly into what the more spiritual reasons might be. What are the differences in the worlds these people see around them, and in what they see as the strengths of their nation?

A good place to start exploring that is the summer of 1976, when politicians were given to speaking floridly on the subject of what America is all about. At the national political conventions that summer, Gerald Ford and Jimmy Carter both referred in their acceptance speeches to the Founding Fathers.

"Their vision," said Ford, not entirely accurately, "was of free men and free women enjoying limited government and unlimited opportunity."

Carter, also not entirely accurately, said the founders envisioned a country whose purpose would be "that of a pioneer in shaping more decent and just relations among people and among societies."

Those are two quite different Americas -- the Democratic America, where collaboration is at the center of the vision, and the Republican America, where individualism, in the name of upward mobility, is stressed. And they correspond to the different lives of the 14th district of Ilinois and the 22nd of Ohio.

The Illinois district is on the way up, and people's upward economic mobility seems to define them more strongly than their ethnic or economic background. The city of Chicago is only a distant presence; DuPage County seems to those living there to be a world unto itself.

The Ohio district is just as well-off, but it isn't on the way up any more, and hasn't been for 20 years. The idea of people's economic progress being hampered is therefore not as horrifying to them. Conversely, American society seems from the district's vantage point to be much more an agglomeration of disparate elements, some of which are dependent on others. The district's 14,000 senior citizens need federal housing and health programs. The people in the East Cleveland ghetto, just across the district line need welfare and food stamps. Even the children of the late-middle-aged couples in Shaker Heights in many cases are clearly destined to live less well than their parents. So the economy seems much less intrinsically fair.

That's why, answering dozens of questions about this county, residents of two districts split most sharply over one having to do with the fairness of the system: Do we have a class system in this country? "Well, in practice there is," says Mary Boyle of Cleveland Heights. "In practice, some people are born without a chance."

"Is there a class system?" says Jeri Sullivan of DuPage County, like Boyle an Irish Catholic married woman in her 30s, the daughter of Chicago Democrats and a Republican trustee of Glendale Heights, Ill. "You know, when I was growing up in Chicago, I would have said yes, but in DuPage County, I'd say no. People can come here from any walk of life."