Perhaps humanity is overly narcissistic, but few problems are so fascinating to us as our own, complex and intelligent minds. For over a century, debates have raged over so-called intelligence tests, used in schools, in armies, and in the offices of clinical psychologists-what do such tests mean? what do they miss? can a single score capture any of the richness of human nature and talent? We wonder how human intelligence differs from the intelligence of other animals, and how our biological intelligence relates to the artificial intelligence of thinking computers. Looking around us, it is obvious that intelligence is everywhere, building the very world we inhabit. Cities, electric lights, immense cornfields, a sea filled with ships and a sky filled with aircraft, microchips, the equations of thermodynamics-little in our world is now untouched by the power of our own minds. "How intelligence happens" is the story of the discoveries and insights that begin to show us how brain creates mind, and how a structure of many billions of tiny biological cells, conducting brief electrical impulses in networks of astonishing complexity, can create rational, intelligent thought. In the past two decades, our understanding of the human brain has been transformed by new methods of brain imaging, using MRI scans to look into the brain as it works. Much of the picture agrees with what we would have expected from more than a century of clinical neurology, with small regions of the cerebral cortex devoted to specific functions. In the occipital and temporal lobes of the brain, for example, small regions respond to different kinds of visual input, perhaps recognizing faces or identifying the spatial layout of a scene. Other specific regions store detailed knowledge of words and their meanings, or control how we reach out and grasp an object on the table in front of us. Less expected was the discovery of a new, integrated network of regions in the brain's frontal and parietal lobes. Rather than local experts, these regions are generalists, involved in any line of thought we may pursue. Brain imaging shows activity in this network for any type of cognitive demand-understanding ambiguous words, retrieving a distant memory, resisting a dominant impulse, even identifying a briefly-flashed visual object. Critically, these also are the regions that are highly active in intelligence tests-puzzles such as completing a sequence of numbers or picking the odd one out in a row of geometrical shapes. The results suggest a specific seat in the brain for human intelligence-at least that kind of intelligence that is measured in standard tests, and that helps us to do well in all manner of activities, no matter what they may be. But to find out where in the brain something happens is not to tell us what that something is. Can we understand how it works-the physiological functions that, in a specific brain network, allow us to direct and organize our thoughts? One critical clue comes from brain damage in conditions ranging from stroke and brain tumours to head injuries in soldiers or the victims of traffic accidents. Following damage to the frontal lobes, there can be startling changes in thought and personality. A person who previously held down a complex, high-flying job can now be incapable of organizing even simple activities, sometimes frozen in apparent inability to formulate a plan of action, sometimes drifting into behaviour that seems irrelevant, inconsequential. The human consequences can easily be imagined; for many decades through the 20th century, however, the scientific implications proved harder to see. Perhaps the clearest insights came from the great Russian neuropsychologist Aleksandr Luria, who described the chaotic lives of frontal lobe patients as a loss of programming-a failure to transform goals into a structured, organized sequence of behavior allowing those goals to be achieved. Can clues accordingly be found in artificial intelligence, and in the structure of programs that allow thinking computers to prove theorems in logic or to plan a day's errands in town? Indeed, thinking computers solve complex problems in a very characteristic way. It is not possible to plan behavior in one massive, complex step. You cannot say "I want to plan a trip to the Azores" and proceed at once to ask "What should I do with my right hand?" On its own, a desire to reach the Azores is simply not enough to proceed immediately to movements of the forelimbs. Instead the problem must be broken down into smaller and smaller parts-to travel on a plane-to acquire tickets-to log onto the Internet-until at last, within one small problem, it becomes clear that the first step is to reach out to the laptop and open the lid. Large problems must be broken down into a structure of microproblems, or episodes of focused attention to one small fragment of behavior and thought. In frontal lobe patients, these attentional fragments fail, and the whole structure is broken. Instead of an organized plan, there is the chaos of thought not directed by its goal. Now we can go back to physiology, and ask what happens, in the many millions of cells making up the frontal-parietal network, as an animal moves through a structured behavioural plan. In much of the brain, as we should expect, nerve cells or neurons have largely dedicated functions. One neuron may fire at the sight of a staring face, a potentially critical social signal-another when the animal moves into a particular part of the room, updating its mental map of current location-just as we should expect in a dedicated expert transmitting specific information to the rest of the network. In parts of the frontal and parietal lobes, however, we again see generalists rather than experts. Now the network codes not fixed, specific information but rather the particular contents of a current task, whatever this task may happen to be. It is early days for this research, but already we sense a system that indeed creates attentional episodes, assembling the specific information that is needed in the current fragment of behavior. If a system of this sort is broken, we might indeed expect the chaotic behavior of people with damaged frontal lobes; and when it works well, it is a critical physiological underpinning for intelligent rationality. The story of "How intelligence happens" is the story of how, with these experiments, psychologists, physiologists and computer scientists have come together to explain how human intelligence emerges from a working brain. We are used to thinking that the mind is an insoluble mystery, and that psychology is only on the margins of science. In the 1950s, when the physiologist Karl Lashley looked forward to a possible "physiology of logic", this prospect was only a dream of uniting mind with brain. While the picture we have now is at best an outline sketch, it is certainly not at all a dream. It brings together the classical intelligence studies of the psychologist Charles Spearman, working at the start of the twentieth century-the pioneering work of Allen Newell and Herbert Simon creating the first logical computers of the late 1950s-the clinical insights of Luria and the modern discoveries of brain imaging and electrophysiology. I liken it to an early map of the world, with many parts crudely sketched in, many parts labeled simply "unknown", but still visibly round and with the right general shape of the continents. It is crude, but already it tells us where we should look for more. Creating this map has been one of the great intellectual challenges of the last century; filling it out will be one of the great adventures of the next.