IN THE FALL of 1993, a man who would upend much of what we know about habits walked into a laboratory in San Diego for a scheduled appointment. He was elderly, a shade over six feet tall, and neatly dressed in a blue button-down shirt.1 His thick white hair would have inspired envy at any fiftieth high school reunion. Arthritis caused him to limp slightly as he paced the laboratory’s hallways, and he held his wife’s hand, walking slowly, as if unsure about what each new step would bring.

About a year earlier, Eugene Pauly, or “E.P.” as he would come to be known in medical literature, had been at home in Playa del Rey, preparing for dinner, when his wife mentioned that their son, Michael, was coming over.

“Who’s Michael?” Eugene asked.

“Your child,” said his wife, Beverly. “You know, the one we raised?”

Eugene looked at her blankly. “Who is that?” he asked.

The next day, Eugene started vomiting and writhing with stomach cramps. Within twenty-four hours, his dehydration was so pronounced that a panicked Beverly took him to the emergency room. His temperature started rising, hitting 105 degrees as he sweated a yellow halo of perspiration onto the hospital’s sheets. He became delirious, then violent, yelling and pushing when nurses tried to insert an IV into his arm. Only after sedation was a physician able to slide a long needle between two vertebra in the small of his back and extract a few drops of cerebrospinal fluid.

The doctor performing the procedure sensed trouble immediately. The fluid surrounding the brain and spinal nerves is a barrier against infection and injury. In healthy individuals, it is clear and quick flowing, moving with an almost silky rush through a needle. The sample from Eugene’s spine was cloudy and dripped out sluggishly, as if filled with microscopic grit.3 When the results came back from the laboratory, Eugene’s physicians learned why he was ill: He was suffering from viral encephalitis, a disease caused by a relatively harmless virus that produces cold sores, fever blisters, and mild infections on the skin. In rare cases, however, the virus can make its way into the brain, inflicting catastrophic damage as it chews through the delicate folds of tissue where our thoughts, dreams — and according to some, souls — reside.

Eugene’s doctors told Beverly there was nothing they could do to counter the damage already done, but a large dose of antiviral drugs might prevent it from spreading. Eugene slipped into a coma and for ten days was close to death. Gradually, as the drugs fought the disease, his fever receded and the virus disappeared. When he finally awoke, he was weak and disoriented and couldn’t swallow properly. He couldn’t form sentences and would sometimes gasp, as if he had momentarily forgotten how to breathe. But he was alive.

Eventually, Eugene was well enough for a battery of tests. The doctors were amazed to find that his body — including his nervous system — appeared largely unscathed. He could move his limbs and was responsive to noise and light. Scans of his head, though, revealed ominous shadows near the center of his brain. The virus had destroyed an oval of tissue close to where his cranium and spinal column met. “He might not be the person you remember,” one doctor warned Beverly. “You need to be ready if your husband is gone.”

Eugene was moved to a different wing of the hospital. Within a week, he was swallowing easily. Another week, and he started talking normally, asking for Jell-O and salt, flipping through television channels and complaining about boring soap operas. By the time he was discharged to a rehabilitation center five weeks later, Eugene was walking down hallways and offering nurses unsolicited advice about their weekend plans.

“I don’t think I’ve ever seen anyone come back like this,” a doctor told Beverly. “I don’t want to raise your hopes, but this is amazing.”

Beverly, however, remained concerned. In the rehab hospital it became clear that the disease had changed her husband in unsettling ways. Eugene couldn’t remember which day of the week it was, for instance, or the names of his doctors and nurses, no matter how many times they introduced themselves. “Why do they keep asking me all these questions?” he asked Beverly one day after a physician left his room. When he finally returned home, things got even stranger. Eugene didn’t seem to remember their friends. He had trouble following conversations. Some mornings, he would get out of bed, walk into the kitchen, cook himself bacon and eggs, then climb back under the covers and turn on the radio. Forty minutes later, he would do the same thing: get up, cook bacon and eggs, climb back into bed, and fiddle with the radio. Then he would do it again.

Alarmed, Beverly reached out to specialists, including a researcher at the University of California, San Diego, who specialized in memory loss. Which is how, on a sunny fall day, Beverly and Eugene found themselves in a nondescript building on the university’s campus, holding hands as they walked slowly down a hallway. They were shown into a small exam room. Eugene began chatting with a young woman who was using a computer.

“Having been in electronics over the years, I’m amazed at all this,” he said, gesturing at the machine she was typing on. “When I was younger, that thing would have been in a couple of six-foot racks and taken up this whole room.”

The woman continued pecking at the keyboard. Eugene chuckled.

“That is incredible,” he said. “All those printed circuits and diodes and triodes. When I was in electronics, there would have been a couple of six-foot racks holding that thing.”

A scientist entered the room and introduced himself. He asked Eugene how old he was.

“Oh, let’s see, fifty-nine or sixty?” Eugene replied. He was seventy-one years old.

The scientist started typing on the computer. Eugene smiled and pointed at it. “That is really something,” he said. “You know, when I was in electronics there would have been a couple of six-foot racks holding that thing!”

The scientist was fifty-two-year-old Larry Squire, a professor who had spent the past three decades studying the neuroanatomy of memory. His specialty was exploring how the brain stores events. His work with Eugene, however, would soon open a new world to him and hundreds of other researchers who have reshaped our understanding of how habits function. Squire’s studies would show that even someone who can’t remember his own age or almost anything else can develop habits that seem inconceivably complex — until you realize that everyone relies on similar neurological processes every day. His and others’ research would help reveal the subconscious mechanisms that impact the countless choices that seem as if they’re the products of well-reasoned thought, but actually are influenced by urges most of us barely recognize or understand.

By the time Squire met Eugene, he had already been studying images of his brain for weeks. The scans indicated that almost all the damage within Eugene’s skull was limited to a five-centimeter area near the center of his head. The virus had almost entirely destroyed his medial temporal lobe, a sliver of cells which scientists suspected was responsible for all sorts of cognitive tasks such as recall of the past and the regulation of some emotions. The completeness of the destruction didn’t surprise Squire — viral encephalitis consumes tissue with a ruthless, almost surgical, precision. What shocked him was how familiar the images seemed.

Thirty years earlier, as a PhD student at MIT, Squire had worked alongside a group studying a man known as “H.M.,” one of the most famous patients in medical history. When H.M. — his real name was Henry Molaison, but scientists shrouded his identity throughout his life — was seven years old,4 he was hit by a bicycle5 and landed hard on his head.6 Soon afterward, he developed seizures and started blacking out. At sixteen, he had his first grand mal seizure, the kind that affects the entire brain; soon, he was losing consciousness up to ten times a day.

By the time he turned twenty-seven, H.M. was desperate. Anti-convulsive drugs hadn’t helped. He was smart, but couldn’t hold a job. He still lived with his parents. H.M. wanted a normal existence. So he sought help from a physician whose tolerance for experimentation outweighed his fear of malpractice. Studies had suggested that an area of the brain called the hippocampus might play a role in seizures. When the doctor proposed cutting into H.M.’s head, lifting up the front portion of his brain, and, with a small straw, sucking out the hippocampus and some surrounding tissue from the interior of his skull, H.M. gave his consent.

The surgery occurred in 1953, and as H.M. healed, his seizures slowed. Almost immediately, however, it became clear that his brain had been radically altered. H.M. knew his name and that his mother was from Ireland. He could remember the 1929 stock market crash and news reports about the invasion of Normandy. But almost everything that came afterward — all the memories, experiences, and struggles from most of the decade before his surgery — had been erased. When a doctor began testing H.M.’s memory by showing him playing cards and lists of numbers, he discovered that H.M. couldn’t retain any new information for more than twenty seconds or so.

From the day of his surgery until his death in 2008, every person H.M. met, every song he heard, every room he entered, was a completely fresh experience. His brain was frozen in time. Each day, he was befuddled by the fact that someone could change the television channel by pointing a black rectangle of plastic at the screen. He introduced himself to his doctors and nurses over and over, dozens of times each day.

“I loved learning about H.M., because memory seemed like such a tangible, exciting way to study the brain,” Squire told me. “I grew up in Ohio, and I can remember, in first grade, my teacher handing everyone crayons, and I started mixing all the colors together to see if it would make black. Why have I kept that memory, but I can’t remember what my teacher looked like? Why does my brain decide that one memory is more important than another?”

When Squire received the images of Eugene’s brain, he marveled at how similar it seemed to H.M.’s. There were empty, walnut-sized chunks in the middle of both their heads. Eugene’s memory — just like H.M.’s — had been removed.

As Squire began examining Eugene, though, he saw that this patient was different from H.M. in some profound ways. Whereas almost everyone knew within minutes of meeting H.M. that something was amiss, Eugene could carry on conversations and perform tasks that wouldn’t alert a casual observer that anything was wrong. The effects of H.M.’s surgery had been so debilitating that he was institutionalized for the remainder of his life. Eugene, on the other hand, lived at home with his wife. H.M. couldn’t really carry on conversations. Eugene, in contrast, had an amazing knack for guiding almost any discussion to a topic he was comfortable talking about at length, such as satellites — he had worked as a technician for an aerospace company — or the weather.

Squire started his exam of Eugene by asking him about his youth. Eugene talked about the town where he had grown up in central California, his time in the merchant marines, a trip he had taken to Australia as a young man. He could remember most of the events in his life that had occurred prior to about 1960. When Squire asked about later decades, Eugene politely changed the topic and said he had trouble recollecting some recent events.

Squire conducted a few intelligence tests and found that Eugene’s intellect was still sharp for a man who couldn’t remember the last three decades. What’s more, Eugene still had all the habits he had formed in his youth, so whenever Squire gave him a cup of water or complimented him on a particularly detailed answer, Eugene would thank him and offer a compliment in return. Whenever someone entered the room, Eugene would introduce himself and ask about their day.

But when Squire asked Eugene to memorize a string of numbers or describe the hallway outside the laboratory’s door, the doctor found his patient couldn’t retain any new information for more than a minute or so. When someone showed Eugene photos of his grandchildren, he had no idea who they were. When Squire asked if he remembered getting sick, Eugene said he had no recollection of his illness or the hospital stay. In fact, Eugene almost never recalled that he was suffering from amnesia. His mental image of himself didn’t include memory loss, and since he couldn’t remember the injury, he couldn’t conceive of anything being wrong.

In the months after meeting Eugene, Squire conducted experiments that tested the limits of his memory. By then, Eugene and Beverly had moved from Playa del Rey to San Diego to be closer to their daughter, and Squire often visited their home for his exams. One day, Squire asked Eugene to sketch a layout of his house. Eugene couldn’t draw a rudimentary map showing where the kitchen or bedroom was located. “When you get out of bed in the morning, how do you leave your room?” Squire asked.

“You know,” Eugene said, “I’m not really sure.”

Squire took notes on his laptop, and as the scientist typed, Eugene became distracted. He glanced across the room and then stood up, walked into a hallway, and opened the door to the bathroom. A few minutes later, the toilet flushed, the faucet ran, and Eugene, wiping his hands on his pants, walked back into the living room and sat down again in his chair next to Squire. He waited patiently for the next question.

At the time, no one wondered how a man who couldn’t draw a map of his home was able to find the bathroom without hesitation. But that question, and others like it, would eventually lead to a trail of discoveries that has transformed our understanding of habits’ power. It would help spark a scientific revolution that today involves hundreds of researchers who are learning, for the first time, to understand all the habits that influence our lives.

As Eugene sat at the table, he looked at Squire’s laptop.

“That’s amazing,” he said, gesturing at the computer. “You know, when I was in electronics, there would have been a couple of six-foot racks holding that thing.”

In the first few weeks after they moved into their new house, Beverly tried to take Eugene outside each day. The doctors had told her that it was important for him to get exercise, and if Eugene was inside too long he drove Beverly crazy, asking her the same questions over and over in an endless loop. So each morning and afternoon, she took him on a walk around the block, always together and always along the same route.

The doctors had warned Beverly that she would need to monitor Eugene constantly. If he ever got lost, they said, he would never be able to find his way home. But one morning, while she was getting dressed, Eugene slipped out the front door. He had a tendency to wander from room to room, so it took her a while to notice he was gone. When she did, she became frantic. She ran outside and scanned the street. She couldn’t see him. She went to the neighbors’ house and pounded on the windows. Their homes looked similar — maybe Eugene had become confused and had gone inside? She ran to the door and rang the bell until someone answered. Eugene wasn’t there. She s printed back to the street, running up the block, screaming Eugene’s name. She was crying. What if he had wandered into traffic? How would he tell anyone where he lived? She had been outside for fifteen minutes already, looking everywhere. She ran home to call the police.

When she burst through the door, she found Eugene in the living room, sitting in front of the television watching the History Channel. Her tears confused him. He didn’t remember leaving, he said, didn’t know where he’d been, and couldn’t understand why she was so upset. Then Beverly saw a pile of pinecones on the table, like the ones she’d seen in a neighbor’s yard down the street. She came closer and looked at Eugene’s hands. His fingers were sticky with sap. That’s when she realized that Eugene had gone for a walk by himself. He had wandered down the street and collected some souvenirs.

And he had found his way home.

Soon, Eugene was going for walks every morning. Beverly tried to stop him, but it was pointless.

“Even if I told him to stay inside, he wouldn’t remember a few minutes later,” she told me. “I followed him a few times to make sure he wouldn’t get lost, but he always came back.” Sometimes he would return with pinecones or rocks. Once he came back with a wallet; another time with a puppy. He never remembered where they came from.

When Squire and his assistants heard about these walks, they started to suspect that something was happening inside Eugene’s head that didn’t have anything to do with his conscious memory. They designed an experiment. One of Squire’s assistants visited the house one day and asked Eugene to draw a map of the block where he lived. He couldn’t do it. How about where his house was located on the street, she asked. He doodled a bit, then forgot the assignment. She asked him to point out which doorway led to the kitchen. Eugene looked around the room. He didn’t know, he said. She asked Eugene what he would do if he were hungry. He stood up, walked into the kitchen, opened a cabinet, and took down a jar of nuts.

Later that week, a visitor joined Eugene on his daily stroll. They walked for about fifteen minutes through the perpetual spring of Southern California, the scent of bougainvillea heavy in the air. Eugene didn’t say much, but he always led the way and seemed to know where he was going. He never asked for directions. As they rounded the corner near his house, the visitor asked Eugene where he lived. “I don’t know, exactly,” he said. Then he walked up his sidewalk, opened his front door, went into the living room, and turned on the television.

It was clear to Squire that Eugene was absorbing new information. But where inside his brain was that information residing? How could someone find a jar of nuts when he couldn’t say where the kitchen was located? Or find his way home when he had no idea which house was his? How, Squire wondered, were new patterns forming inside Eugene’s damaged brain?

II.

Within the building that houses the Brain and Cognitive Sciences department of the Massachusetts Institute of Technology are laboratories that contain what, to the casual observer, look like dollhouse versions of surgical theaters. There are tiny scalpels, small drills, and miniature saws less than a quarter inch wide attached to robotic arms. Even the operating tables are tiny, as if prepared for child-sized surgeons. The rooms are always kept at a chilly sixty degrees because a slight nip in the air steadies researchers’ fingers during delicate procedures. Inside these laboratories, neurologists cut into the skulls of anesthetized rats, implanting tiny sensors that can record the smallest changes inside their brains. When the rats wake, they hardly seem to notice that there are now dozens of microscopic wires arrayed, like neurological spider webs, inside their heads.

These laboratories have become the epicenter for a quiet revolution in the science of habit formation, and the experiments unfolding here explain how Eugene — as well as you, me, and everyone else — developed the behaviors necessary to make it through each day. The rats in these labs have illuminated the complexity that occurs inside our heads whenever we do something as mundane as brush our teeth or back the car out of the driveway. And for Squire, these laboratories helped explain how Eugene managed to learn new habits.

When the MIT researchers started working on habits in the 1990s — at about the same time that Eugene came down with his fever — they were curious about a nub of neurological tissue known as the basal ganglia. If you picture the human brain as an onion, composed of layer upon layer of cells, then the outside layers — those closest to the scalp — are generally the most recent additions from an evolutionary perspective. When you dream up a new invention or laugh at a friend’s joke, it’s the outside parts of your brain at work. That’s where the most complex thinking occurs.

Deeper inside the brain and closer to the brain stem — where the brain meets the spinal column — are older, more primitive structures. They control our automatic behaviors, such as breathing and swallowing, or the startle response we feel when someone leaps out from behind a bush. Toward the center of the skull is a golf ballsized lump of tissue that is similar to what you might find inside the head of a fish, reptile, or mammal. This is the basal ganglia, an oval of cells that, for years, scientists didn’t understand very well, except for suspicions that it played a role in diseases such as Parkinson’s.

In the early 1990s, the MIT researchers began wondering if the basal ganglia might be integral to habits as well. They noticed that animals with injured basal ganglia suddenly developed problems with tasks such as learning how to run through mazes or remembering how to open food containers. They decided to experiment by employing new micro-technologies that allowed them to observe, in minute detail, what was occurring within the heads of rats as they performed dozens of routines. In surgery, each rat had what looked like a small joystick and dozens of tiny wires inserted into its skull. Afterward, the animal was placed into a T-shaped maze with chocolate at one end.

The maze was structured so that each rat was positioned behind a partition that opened when a loud click sounded. Initially, when a rat heard the click and saw the partition disappear, it would usually wander up and down the center aisle, sniffing in corners and scratching at walls. It appeared to smell the chocolate, but couldn’t figure out how to find it. When it reached the top of the T, it often turned to the right, away from the chocolate, and then wandered left, sometimes pausing for no obvious reason. Eventually, most animals discovered the reward. But there was no discernible pattern in their meanderings. It seemed as if each rat was taking a leisurely, unthinking stroll.

The probes in the rats’ heads, however, told a different story. While each animal wandered through the maze, its brain — and in particular, its basal ganglia — worked furiously. Each time a rat sniffed the air or scratched a wall, its brain exploded with activity, as if analyzing each new scent, sight, and sound. The rat was processing information the entire time it meandered.

The scientists repeated their experiment, again and again, watching how each rat’s brain activity changed as it moved through the same route hundreds of times. A series of shifts slowly emerged. The rats stopped sniffing corners and making wrong turns. Instead, they zipped through the maze faster and faster. And within their brains, something unexpected occurred: As each rat learned how to navigate the maze, its mental activity decreased. As the route became more and more automatic, each rat started thinking less and less.

It was as if the first few times a rat explored the maze, its brain had to work at full power to make sense of all the new information. But after a few days of running the same route, the rat didn’t need to scratch the walls or smell the air anymore, and so the brain activity associated with scratching and smelling ceased. It didn’t need to choose which direction to turn, and so decision-making centers of the brain went quiet. All it had to do was recall the quickest path to the chocolate. Within a week, even the brain structures related to memory had quieted. The rat had internalized how to sprint through the maze to such a degree that it hardly needed to think at all.

But that internalization — run straight, hang a left, eat the chocolate — relied upon the basal ganglia, the brain probes indicated. This tiny, ancient neurological structure seemed to take over as the rat ran faster and faster and its brain worked less and less. The basal ganglia was central to recalling patterns and acting on them. The basal ganglia, in other words, stored habits even while the rest of the brain went to sleep.

To see this capacity in action, consider this graph, which shows activity within a rat’s skull as it encounters the maze for the first time. Initially, the brain is working hard the entire time:

After a week, once the route is familiar and the scurrying has become a habit, the rat’s brain settles down as it runs through the maze:

This process — in which the brain converts a sequence of actions into an automatic routine — is known as “chunking,” and it’s at the root of how habits form. There are dozens — if not hundreds — of behavioral chunks that we rely on every day. Some are simple: You automatically put toothpaste on your toothbrush before sticking it in your mouth. Some, such as getting dressed or making the kids’ lunch, are a little more complex.

Others are so complicated that it’s remarkable a small bit of tissue that evolved millions of years ago can turn them into habits at all. Take the act of backing your car out of the driveway. When you first learned to drive, the driveway required a major dose of concentration, and for good reason: It involves opening the garage, unlocking the car door, adjusting the seat, inserting the key in the ignition, turning it clockwise, moving the rearview and side mirrors and checking for obstacles, putting your foot on the brake, moving the gearshift into reverse, removing your foot from the brake, mentally estimating the distance between the garage and the street while keeping the wheels aligned and monitoring for oncoming traffic, calculating how reflected images in the mirrors translate into actual distances between the bumper, the garbage cans, and the hedges, all while applying slight pressure to the gas pedal and brake, and, most likely, telling your passenger to please stop fiddling with the radio.

Nowadays, however, you do all of that every time you pull onto the street with hardly any thought. The routine occurs by habit.

Millions of people perform this intricate ballet every morning, unthinkingly, because as soon as we pull out the car keys, our basal ganglia kicks in, identifying the habit we’ve stored in our brains related to backing an automobile into the street. Once that habit starts unfolding, our gray matter is free to quiet itself or chase other thoughts, which is why we have enough mental capacity to realize that Jimmy forgot his lunchbox inside.

Habits, scientists say, emerge because the brain is constantly looking for ways to save effort. Left to its own devices, the brain will try to make almost any routine into a habit, because habits allow our minds to ramp down more often. This effort-saving instinct is a huge advantage. An efficient brain requires less room, which makes for a smaller head, which makes childbirth easier and therefore causes fewer infant and mother deaths. An efficient brain also allows us to stop thinking constantly about basic behaviors, such as walking and choosing what to eat, so we can devote mental energy to inventing spears, irrigation systems, and, eventually, airplanes and video games.

But conserving mental effort is tricky, because if our brains power down at the wrong moment, we might fail to notice something important, such as a predator hiding in the bushes or a speeding car as we pull onto the street. So our basal ganglia have devised a clever system to determine when to let habits take over. It’s something that happens whenever a chunk of behavior starts or ends.

To see how it works, look closely at the graph of the rat’s neurological habit again. Notice that brain activity spikes at the beginning of the maze, when the rat hears the click before the partition starts moving, and again at the end, when it finds the chocolate.

Those spikes are the brain’s way of determining when to cede control to a habit, and which habit to use. From behind a partition, for instance, it’s difficult for a rat to know if it’s inside a familiar maze or an unfamiliar cupboard with a cat lurking outside. To deal with this uncertainty, the brain spends a lot of effort at the beginning of a habit looking for something — a cue — that offers a hint as to which pattern to use. From behind a partition, if a rat hears a click, it knows to use the maze habit. If it hears a meow, it chooses a different pattern. And at the end of the activity, when the reward appears, the brain shakes itself awake and makes sure everything unfolded as expected.

This process within our brains is a three-step loop. First, there is a cue, a trigger that tells your brain to go into automatic mode and which habit to use. Then there is the routine, which can be physical or mental or emotional. Finally, there is a reward, which helps your brain figure out if this particular loop is worth remembering for the future:

Over time, this loop — cue, routine, reward; cue, routine, reward — becomes more and more automatic. The cue and reward become intertwined until a powerful sense of anticipation and craving emerges. Eventually, whether in a chilly MIT laboratory or your driveway, a habit is born.

Habits aren’t destiny. As the next two chapters explain, habits can be ignored, changed, or replaced. But the reason the discovery of the habit loop is so important is that it reveals a basic truth: When a habit emerges, the brain stops fully participating in decision making. It stops working so hard, or diverts focus to other tasks. So unless you deliberately fight a habit — unless you find new routines — the pattern will unfold automatically.

However, simply understanding how habits work — learning the structure of the habit loop — makes them easier to control. Once you break a habit into its components, you can fiddle with the gears.

“We’ve done experiments where we trained rats to run down a maze until it was a habit, and then we extinguished the habit by changing the placement of the reward,” Ann Graybiel, a scientist at MIT who oversaw many of the basal ganglia experiments, told me. “Then one day, we’ll put the reward in the old place, and put in the rat, and, by golly, the old habit will reemerge right away. Habits never really disappear. They’re encoded into the structures of our brain, and that’s a huge advantage for us, because it would be awful if we had to relearn how to drive after every vacation. The problem is that your brain can’t tell the difference between bad and good habits, and so if you have a bad one, it’s always lurking there, waiting for the right cues and rewards.”

This explains why it’s so hard to create exercise habits, for instance, or change what we eat. Once we develop a routine of sitting on the couch, rather than running, or snacking whenever we pass a doughnut box, those patterns always remain inside our heads. By the same rule, though, if we learn to create new neurological routines that overpower those behaviors — if we take control of the habit loop — we can force those bad tendencies into the background, just as Lisa Allen did after her Cairo trip. And once someone creates a new pattern, studies have demonstrated, going for a jog or ignoring the doughnuts becomes as automatic as any other habit.

Without habit loops, our brains would shut down, overwhelmed by the minutiae of daily life. People whose basal ganglia are damaged by injury or disease often become mentally paralyzed. They have trouble performing basic activities, such as opening a door or deciding what to eat. They lose the ability to ignore insignificant details — one study, for example, found that patients with basal ganglia injuries couldn’t recognize facial expressions, including fear and disgust, because they were perpetually uncertain about which part of the face to focus on. Without our basal ganglia, we lose access to the hundreds of habits we rely on every day. Did you pause this morning to decide whether to tie your left or right shoe first? Did you have trouble figuring out if you should brush your teeth before or after you showered?

Of course not. Those decisions are habitual, effortless. As long as your basal ganglia is intact and the cues remain constant, the behaviors will occur unthinkingly. (Though when you go on vacation, you may get dressed in different ways or brush your teeth at a different point in your morning routine without noticing it.)

At the same time, however, the brain’s dependence on automatic routines can be dangerous. Habits are often as much a curse as a benefit.

Take Eugene, for instance. Habits gave him his life back after he lost his memory. Then they took everything away again.

III.

As Larry Squire, the memory specialist, spent more and more time with Eugene, he became convinced his patient was somehow learning new behaviors. Images of Eugene’s brain showed that his basal ganglia had escaped injury from the viral encephalitis. Was it possible, the scientist wondered, that Eugene, even with severe brain damage, could still use the cue-routine-reward loop? Could this ancient neurological process explain how Eugene was able to walk around the block and find the jar of nuts in the kitchen?

To test if Eugene was forming new habits, Squire devised an experiment. He took sixteen different objects — bits of plastic and brightly colored pieces of toys — and glued them to cardboard rectangles. He then divided them into eight pairs: choice A and choice B. In each pairing, one piece of cardboard, chosen at random, had a sticker placed on the bottom that read “correct.”

Eugene was seated at a table, given a pair of objects, and asked to choose one. Next, he was told to turn over his choice to see if there was a “correct” sticker underneath. This is a common way to measure memory. Since there are only sixteen objects, and they are always presented in the same eight pairings, most people can memorize which item is “correct” after a few rounds. Monkeys can memorize all the “correct” items after eight to ten days.

Eugene couldn’t remember any of the “correct” items, no matter how many times he did the test. He repeated the experiment twice a week for months, looking at forty pairings each day.

“Do you know why you are here today?” a researcher asked at the beginning of one session a few weeks into the experiment.

“I don’t think so,” Eugene said.

“I’m going to show you some objects. Do you know why?”

“Am I supposed to describe them to you, or tell you what they are used for?” Eugene couldn’t recollect the previous sessions at all.

B ut as the weeks passed, Eugene’s performance improved. After twenty-eight days of training, Eugene was choosing the “correct” object 85 percent of the time. At thirty-six days, he was right 95 percent of the time. After one test, Eugene looked at the researcher, bewildered by his success.

“How am I doing this?” he asked her.

“Tell me what is going on in your head,” the researcher said. “Do you say to yourself, ‘I remember seeing that one’?”

“No,” Eugene said. “It’s here somehow or another” — he pointed to his head — “and the hand goes for it.”

To Squire, however, it made perfect sense. Eugene was exposed to a cue: a pair of objects always presented in the same combination. There was a routine: He would choose one object and look to see if there was a sticker underneath, even if he had no idea why he felt compelled to turn the cardboard over. Then there was a reward: the satisfaction he received after finding a sticker proclaiming “correct.” Eventually, a habit loop emerged.

To make sure this pattern was, in fact, a habit, Squire conducted one more experiment. He took all sixteen items and put them in front of Eugene at the same time. He asked him to put all the “correct” objects into one pile.

Eugene had no idea where to begin. “Gosh sakes, how to remember this?” he asked. He reached for one object and started to turn it over. The experimenter stopped him. No, she explained. The task was to put the items in piles. Why was he trying to turn them over?

“That’s just a habit, I think,” he said.

He couldn’t do it. The objects, when presented outside of the context of the habit loop, made no sense to him.

Here was the proof Squire was looking for. The experiments demonstrated that Eugene had the ability to form new habits, even when they involved tasks or objects he couldn’t remember for more than a few seconds. This explained how Eugene managed to go for a walk every morning. The cues — certain trees on corners or the placement of particular mailboxes — were consistent every time he went outside, so though he couldn’t recognize his house, his habits always guided him back to his front door. It also explained why Eugene would eat breakfast three or four times a day, even if he wasn’t hungry. As long as the right cues were present — such as his radio or the morning light through his windows — he automatically followed the script dictated by his basal ganglia.

What’s more, there were dozens of other habits in Eugene’s life that no one noticed until they started looking for them. Eugene’s daughter, for instance, would often stop by his house to say hello. She would talk to her father in the living room for a bit, then go into the kitchen to visit with her mother, and then leave, waving good-bye on her way out the door. Eugene, who had forgotten their earlier conversation by the time she left, would get angry — why was she leaving without chatting? — and then forget why he was upset. But the emotional habit had already started, and so his anger would persist, red hot and beyond his understanding, until it burned itself out.

“Sometimes he would bang the table or curse, and if you asked him why, he’d say ‘I don’t know, but I’m mad!’” Beverly told me. He would kick his chair, or snap at whoever came into the room. Then, a few minutes later, he would smile and talk about the weather. “It was like, once it started, he had to finish the frustration,” she said.

Squire’s new experiment also showed something else: that habits are surprisingly delicate. If Eugene’s cues changed the slightest bit, his habits fell apart. The few times he walked around the block, for instance, and something was different — the city was doing street repairs or a windstorm had blown branches all over the sidewalk — Eugene would get lost, no matter how close he was to home, until a kind neighbor showed him the way to his door. If his daughter stopped to chat with him for ten seconds before she walked out, his anger habit never emerged.

Squire’s experiments with Eugene revolutionized the scientific community’s understanding of how the brain works by proving, once and for all, that it’s possible to learn and make unconscious choices without remembering anything about the lesson or decision making. Eugene showed that habits, as much as memory and reason, are at the root of how we behave. We might not remember the experiences that create our habits, but once they are lodged within our brains they influence how we act — often without our realization.

Since Squire’s first paper on Eugene’s habits was published, the science of habit formation has exploded into a major field of study. Researchers at Duke, Harvard, UCLA, Yale, USC, Princeton, the University of Pennsylvania, and at schools in the United Kingdom, Germany, and the Netherlands, as well as corporate scientists working for Procter & Gamble, Microsoft, Google, and hundreds of other companies are focused on understanding the neurology and psychology of habits, their strengths and weaknesses, and why they emerge and how they can be changed.

Researchers have learned that cues can be almost anything, from a visual trigger such as a candy bar or a television commercial to a certain place, a time of day, an emotion, a sequence of thoughts, or the company of particular people. Routines can be incredibly complex or fantastically simple (some habits, such as those related to emotions, are measured in milliseconds). Rewards can range from food or drugs that cause physical sensations, to emotional payoffs, such as the feelings of pride that accompany praise or self-congratulation.

And in almost every experiment, researchers have seen echoes of Squire’s discoveries with Eugene: Habits are powerful, but delicate. They can emerge outside our consciousness, or can be deliberately designed. They often occur without our permission, but can be reshaped by fiddling with their parts. They shape our lives far more than we realize — they are so strong, in fact, that they cause our brains to cling to them at the exclusion of all else, including common sense.

In one set of experiments, for example, researchers affiliated with the National Institute on Alcohol Abuse and Alcoholism trained mice to press levers in response to certain cues until the behavior became a habit. The mice were always rewarded with food. Then, the scientists poisoned the food so that it made the animals violently ill, or electrified the floor, so that when the mice walked toward their reward they received a shock. The mice knew the food and cage were dangerous — when they were offered the poisoned pellets in a bowl or saw the electrified floor panels, they stayed away. When they saw their old cues, however, they unthinkingly pressed the lever and ate the food, or they walked across the floor, even as they vomited or jumped from the electricity. The habit was so ingrained the mice couldn’t stop themselves.

It’s not hard to find an analog in the human world. Consider fast food, for instance. It makes sense — when the kids are starving and you’re driving home after a long day — to stop, just this once, at McDonald’s or Burger King. The meals are inexpensive. It tastes so good. After all, one dose of processed meat, salty fries, and sugary soda poses a relatively small health risk, right? It’s not like you do it all the time.

But habits emerge without our permission. Studies indicate that families usually don’t intend to eat fast food on a regular basis. What happens is that a once a month pattern slowly becomes once a week, and then twice a week — as the cues and rewards create a habit — until the kids are consuming an unhealthy amount of hamburgers and fries. When researchers at the University of North Texas and Yale tried to understand why families gradually increased their fast food consumption, they found a series of cues and rewards that most customers never knew were influencing their behaviors. They discovered the habit loop.

Every McDonald’s, for instance, looks the same — the company deliberately tries to standardize stores’ architecture and what employees say to customers, so everything is a consistent cue to trigger eating routines. The foods at some chains are specifically engineered to deliver immediate rewards — the fries, for instance, are designed to begin disintegrating the moment they hit your tongue, in order to deliver a hit of salt and grease as fast as possible, causing your pleasure centers to light up and your brain to lock in the pattern. All the better for tightening the habit loop.

However, even these habits are delicate. When a fast food restaurant closes down, the families that previously ate there will often start having dinner at home, rather than seek out an alternative location. Even small shifts can end the pattern. But since we often don’t recognize these habit loops as they grow, we are blind to our ability to control them. By learning to observe the cues and rewards, though, we can change the routines.

IV.

By 2000, seven years after Eugene’s illness, his life had achieved a kind of equilibrium. He went for a walk every morning. He ate what he wanted, sometimes five or six times a day. His wife knew that as long as the television was tuned to the History Channel, Eugene would settle into his plush chair and watch it regardless of whether it was airing reruns or new programs. He couldn’t tell the difference.

As he got older, however, Eugene’s habits started impacting his life in negative ways. He was sedentary, sometimes watching television for hours at a time because he never grew bored with the shows. His physicians became worried about his heart. The doctors told Beverly to keep him on a strict diet of healthy foods. She tried, but it was difficult to influence how frequently he ate or what he consumed. He never recalled her admonitions. Even if the refrigerator was stocked with fruits and vegetables, Eugene would root around until he found the bacon and eggs. That was his routine. And as Eugene aged and his bones became more brittle, the doctors said he needed to be more careful walking around. In his mind, however, Eugene was twenty years younger. He never remembered to step carefully.

“All my life I was fascinated by memory,” Squire told me. “Then I met E.P., and saw how rich life can be even if you can’t remember it. The brain has this amazing ability to find happiness even when the memories of it are gone.

“It’s hard to turn that off, though, which ultimately worked against him.”

Beverly tried to use her understanding of habits to help Eugene avoid problems as he aged. She discovered that she could short-circuit some of his worst patterns by inserting new cues. If she didn’t keep bacon in the fridge, Eugene wouldn’t eat multiple, unhealthy breakfasts. When she put a salad next to his chair, he would sometimes pick at it, and as the meal became a habit, he stopped searching the kitchen for treats. His diet gradually improved.

Despite these efforts, however, Eugene’s health still declined. One spring day, Eugene was watching television when he suddenly shouted. Beverly ran in and saw him clutching his chest. She called an ambulance. At the hospital, they diagnosed a minor heart attack. By then the pain had passed and Eugene was fighting to get off his gurney. That night, he kept pulling off the monitors attached to his chest so he could roll over and sleep. Alarms would blare and nurses would rush in. They tried to get him to quit fiddling with the sensors by taping the leads in place and telling him they would use restraints if he continued fussing. Nothing worked. He forgot the threats as soon as they were issued.

Then his daughter told a nurse to try complimenting him on his willingness to sit still, and to repeat the compliment, over and over, each time she saw him. “We wanted to, you know, get his pride involved,” his daughter, Carol Rayes, told me. “We’d say, ‘Oh, Dad, you’re really doing something important for science by keeping these doodads in place.’” The nurses started to dote on him. He loved it. After a couple of days, he did whatever they asked. Eugene returned home a week later.

Then, in the fall of 2008, while walking through his living room, Eugene tripped on a ledge near the fireplace, fell, and broke his hip. At the hospital, Squire and his team worried that he would have panic attacks because he wouldn’t know where he was. So they left notes by his bedside explaining what had happened and posted photos of his children on the walls. His wife and kids came every day.

Eugene, however, never grew worried. He never asked why he was in the hospital. “He seemed at peace with all the uncertainty by that point,” said Squire. “It had been fifteen years since he had lost his memory. It was as if part of his brain knew there were some things he would never understand and was okay with that.”

Beverly came to the hospital every day. “I spent a long time talking to him,” she said. “I told him that I loved him, and about our kids and what a good life we had. I pointed to the pictures and talked about how much he was adored. We were married for fifty-seven years, and forty-two of those were a real, normal marriage. Sometimes it was hard, because I wanted my old husband back so much. But at least I knew he was happy.”

A few weeks later, his daughter came to visit. “What’s the plan?” Eugene asked when she arrived. She took him outside in a wheelchair, onto the hospital’s lawn. “It’s a beautiful day,” Eugene said. “Pretty nice weather, huh?” She told him about her kids and they played with a dog. She thought he might be able to come home soon. The sun was going down. She started to get ready to take him inside.

Eugene looked at her.

“I’m lucky to have a daughter like you,” he said. She was caught off-guard. She couldn’t remember the last time he had said something so sweet.

“I’m lucky that you’re my dad,” she told him.

“Gosh, it’s a beautiful day,” he said. “What do you think about the weather?”

That night, at one o’clock in the morning, Beverly’s phone rang. The doctor said Eugene had suffered a massive heart attack and the staff had done everything possible, but hadn’t been able to revive him. He was gone. After his death, he would be celebrated by researchers, the images of his brain studied in hundreds of labs and medical schools.

“I know he would have been really proud to know how much he contributed to science,” Beverly told me. “He told me once, pretty soon after we got married, that he wanted to do something important with his life, something that mattered. And he did. He just never remembered any of it.”