In a world of survival of the fittest, it makes sense that animals are hard-wired with a basic instinct that has them making snap judgments about their predators.
Some chimpanzees attack chimps that are of the same species, but not a part of their group. And some fish attack their own kind simply because they weren't hatched in the same lake.
But what about human beings?
Psychologists say we categorize -- or stereotype -- by age and race and gender, because our brains are wired to do so automatically.
"When you're a social animal, you need to be able to distinguish who's a friend and who's a foe. You need to understand who's a member of your pack, who's a member of a different pack," said John Dovidio, a professor of psychology at the University of Connecticut.
According to Dovidio, even those of us who believe that we don't stereotype, do. "We categorize people automatically, unconsciously, immediately, based on a person's race and based on a person's sex."
When Does It Start?
It begins in childhood. "20/20" brought together three groups of kids and showed them pictures of two men -- one Arab, the other Asian.
When we asked the children which man they liked better, over and over, more kids said they preferred "the Chinese guy."
One child preferred the Chinese man "because he looks nicer and he has a smile on." But both men were smiling.
Several children weighed in on the Arab man's personality, basing their opinions on just seeing his picture. One child said, "I think he's weird." Another child said, "He's like the scary dude."
Next, "20/20" showed the kids pictures of a black man and white man. This time the pictures were different. Here were some of the comments the kids made about the photo of the black man.
One said, "He looks mean." Another referred to him as "FBI's Most Wanted." Another commented, "He looks like he's a basketball player."
When the white man's picture was shown, one child said, "He's nice." Another said, "I think he's nice except he might be mad about something."
The boy was probably picking up on something. The photo of a white man was of Oklahoma City bomber Timothy McVeigh. Admittedly, the pictures were a little bit different, but when we asked which man is a criminal, most kids pointed to the black man. When we asked which man was a teacher, most pointed to McVeigh. This is ironic because the black man pictured was Harvard University professor Roland Fryer.
Most adults claim they don't have these biases, but psychologists who study stereotypes say they do.
Testing for Bias
Harvard University's Implicit Association Test is supposed to measure racial bias. The test flashes pictures of white and black faces and words like "evil" and "nasty," plus words like "joy" and "wonderful," and evaluates whether people associate different words with certain races.
The test is given quickly, so that test-takers don't have time to think consciously.
The test's designers say it can show whether or not you have a preference for anything -- skirts versus pants, Meg Ryan versus Julia Roberts.
"20/20" invited a group of Pace University students to take the test. They said they preferred Julia Roberts, and the test showed they did.
But when we told them the test results revealed other implicit biases, such as one against career women, the elderly, blacks, Arabs and gays, some students got defensive.
Researchers say the test shows what's really in your subconscious, with sometimes surprising results. Not just young people but old people, too, showed an overwhelming bias against the elderly.
"You wouldn't expect that old people would think that old is bad. But the elderly are every bit as negative about the idea of old age as much younger people are," said Anthony Greenwald, a professor of psychology at the University of Washington.
The researchers also found about half of the black people who took this test showed bias against blacks.
Greenwald says many people discover they have biases that they wish they didn't.
"I certainly don't want to think of myself as a racist. But these things are in my head, they show up on the test," said Greenwald.
Of course, the biases in our head are only harmful if we act on them.
In 1999, four New York City police officers shot and killed Amadou Diallo, an immigrant from Guinea, while he reached into his pocket for what the officers feared was a gun but turned out to be his wallet.
Psychologists like Joshua Correll, a professor at the University of Chicago, study how race can affect such real-life decisions.
He has had thousands of people in America take a test in which different scenes flash across the screen. Then a person appears holding either something safe like a cell phone, or something lethal like a gun.
The results? "They shoot very quickly when an armed target is black. They take a little bit longer to shoot when the armed target is white," Correll said.
Even black people are quicker to shoot if the person is black.
"White, black, Latino, Asian, again and again and again, we see this same pattern of effects: bias in the reaction times, bias in the mistakes that they make," Correll said.
According to Correll, the more a test-taker tries to not appear biased the more bias shows up in the test results.
If we all have these subconscious biases. What can we do about them? Psychologists say we can control our conscious actions.
"If we're just aware that it exists, it gives us a chance to do something, to be vigilant to not let our unintended biases -- our implicit biases -- take over our behavior, which can happen unintentionally," Greenwald said.