You can see it the next time you visit your office cafeteria or a nearby park: Whites sitting together with whites, blacks with blacks, young people with other young people. When individuals from these groups mix, it is usually because they share something else in common, such as a pastime.

Sociologists call this phenomenon homophily, a somewhat grand word to describe the idea that birds of a feather flock together. Thinkers from Plato and Aristotle onward have observed that people seem to be drawn to others like themselves.

But while the basic idea is simple, homophily has surprisingly complex causes and consequences. Three weeks ahead of a midterm election, for example, it is playing a powerful, but largely invisible, role in politics.

Studies show that most people interested in politics associate nearly exclusively with others who have similar political beliefs. In fact, research by sociologist David Knoke at the University of Minnesota shows that if you know whether a person's friends are Republicans, Democrats or independents, you can predict with near certainty that person's political views.

Homophily may help explain some of the bitter partisanship of our times -- when your friends are drawn exclusively from one half of the electorate, it is not surprising that you will find the views of the other half inexplicable.

"I often hear people say with absolute certainty that whoever they are in favor of is obviously going to do well because they haven't talked to 'anyone' who supports the other person" in the election, said Lynn Smith-Lovin, a Duke University sociologist who has studied homophily. She rolled her eyes and said, "Oh yeah, sure! That is a good argument."

While the instinct for homophily in politics and other areas seems hard-wired, technology may be fueling our nature. Cable television and the Internet have allowed enormous numbers of people in distant areas to form virtual groups that are very similar to what you see in the office cafeteria.

Smith-Lovin's research, for example, shows that homophily is on the rise in the United States on nearly every dimension of social identity. Ever larger numbers of people seem to be sealing themselves off in worlds where everyone thinks the way they do. No Walter Cronkite figure unites audiences today, the sociologist noted. We can now choose cable stations, magazines and blogs that see the world exactly as we do. If the research on homophily is right, those heavily e-mailed partisan screeds from the op-ed pages are largely talking to those who agree with those points of view to begin with.

But while people may choose blogs or op-ed columnists because they agree with those points of view, do they really choose friends the same way? When was the last time you met someone at a social gathering and quickly asked him his views on abortion, gay marriage and the war in Iraq before deciding to be friends? That does not happen, of course, so one of the most interesting puzzles about homophily is how it turns out that friends often end up having the same views on those subjects.

While beliefs matter, there are two other powerful but subtle factors at work, said sociologist Mario Luis Small of the University of Chicago: One is demography, and the other is shared experiences.

Take, for example, two mothers who become friends after meeting at a day-care center. Beliefs, especially about politics, may never be part of their explicit conversation. But the day-care center exerts a very powerful role in selecting people with similar demographic backgrounds and shared experiences. The mothers are likely to be about the same age, to face common child-rearing challenges and to have similar views on how to balance parenting and work. The fact that they are at this day-care center means they can afford it, which suggests they are in roughly the same socioeconomic class.

"It is not quite the case that I meet you and say, 'Oh my goodness, you also believe in the elimination of Roe v. Wade ,' " said Small. "Two years later, these guys are friends, but it is not because we believe the same things, but our experience and our demographics put us together in the first place."

What this ultimately suggests, Small and Smith-Lovin added, is that while organizations and schools and workplaces and neighborhoods and churches may seem to bring together broad mixes of people, they really do not. Organizations play a very powerful role in bringing together similar people and in creating homogenous views on a variety of topics. University professors, for example, are prone to believe in education, financial aid and research, but those views also lead to other beliefs about the importance of government and activism, Smith-Lovin said.

While there is nothing wrong with being around others who are similar to yourself, both Smith-Lovin and Small said that people and organizations pay a price for homogeneity. In politics, for example, the fact that people rarely have friends with different views makes it difficult to seek common ground or to examine one's positions closely.

"Most of us would be hard-pressed to provide clear explanations for our political beliefs," said Small. "If you ask the average person why they believe what they believe on Roe v. Wade , you are not going to get a coherent answer. We participate in settings where we don't have to explain ourselves because everyone else agrees with us. What this means is, 'I have no reason to challenge or question my own beliefs.' "