The human brain is surely the most sophisticated data-processing machine in the world, except when it's not. In fact, in some ways our brains can be flat-out crude--like when they're dealing with matters of race.

Like all other animals, our species emerged in a world where there was critical value in distinguishing between members of your own tribe--who nurture you and protect you--and members of other tribes, who see you as a competitor for food and mates. Your very survival can turn on making this distinction quickly and reliably; as a result, the primal wiring that makes such discrimination possible is not very easy to disconnect. And in a culture like ours, in which race is an issue we grapple with nearly every day, the impulse may have heightened over time.

In the 1990s, psychologist and social scientist Mahzarin Banaji of Harvard University co-created what's known as the implicit-association test (IAT), a way of exploring the instant connections the brain draws between races and traits. Previously administered only in the lab but now available online (at implicit.harvard.edu) the IAT asks people to pair pictures of white or black faces with positive words like joy, love, peace and happy or negative ones like agony, evil, hurt and failure. Speed is everything, since the survey tests automatic associations. When respondents are told to link the desirable traits to whites and the undesirable ones to blacks, their fingers fairly fly on the keys. When the task is switched, with whites being labeled failures and blacks called glorious, fingers slow considerably, a sure sign the brain is struggling.

When Banaji, along with cognitive neuroscientist Liz Phelps of New York University, conducted brain scans of subjects using functional magnetic resonance imaging, they uncovered the reasons for the results. White subjects respond with greater activation of the amygdala--a region that processes alarm--when shown images of black faces than when shown images of white faces. "One of the amygdala's critical functions is fear-conditioning," says Phelps. "You attend to things that are scary because that's essential for survival." Later studies have shown similar results when black subjects look at white faces.

The brain, of course, is not all amygdala, and there are higher regions that can talk sense to the lower ones. Phelps cites studies showing that when blacks and whites are flashed pictures of faces from the other race so quickly that the subjects weren't consciously aware of seeing them, their amygdalae reacted predictably. When the images were flashed more slowly so that subjects could process them consciously, the anterior cingulate cortex and the dorsolateral prefrontal cortex--regions that temper automatic responses--kicked in.

Phelps conducted other studies in which the images included such friendly faces as Will Smith's and Harrison Ford's and found that this helped control the amygdala too. "The more you think about people as individuals," she says, "the more the brain calms down."

But what about when the brain goes the other way? What about when racism isn't an unconscious bias you wish you didn't have but a hatred you embrace? It's hard to know how ordinary human brains become so twisted, but the problem may begin with our ability to fathom time.

Animal brains operate mostly in the present and past; they know what's happening now, and they recall things that occurred before. When animals encounter an unwelcome outsider, simply driving away the interloper is thus sufficient, since they don't give much thought to whether the intrusion will happen again. Humans, however, operate with awareness of the future, which means we seek to extinguish not only a current threat but also future ones--and that can mean trying to eradicate the entire group that poses the perceived danger.

Worse, as our ability to develop weapons has progressed, our ability to carry out our murderous plans advanced along with it. "For the same aggressive impulse, we can do a lot more killing," says psychologist John Dovodio of Yale University. The bad news is that wisdom, the human faculty that trumps all this, can be very slow to arrive. The good news is that with enough time, both individuals and the species as a whole do acquire it.