Kennedy’s case fit into a new idea Lecky was developing, called self-consistency theory. It posited that people are always striving to create a world in which their ideas of themselves make sense. We are motivated, sometimes above any sense of morality or personal gain, simply to hold our views of ourselves constant. This allows us to maintain a coherent sense of order, even if it means doing things the rest of the world would see as counterproductive.

The idea was never fully formed, and Lecky died at just 48, his work unpublished. But today, the basic concept is seeing a renewed interest from scholars who think Lecky was truly onto something. When the psychologist’s students compiled his writing posthumously, in 1945, the postwar world was grappling with how humans were capable of such catastrophic cruelty. Surely entire armies had not been motivated by their relationships with their mothers. The early science of the mind was beginning to delve into the timeless questions of philosophy and religion: Why do we do destructive things—to others, and to ourselves? Why do we so often act against our own interests? Why would a young boy risk his acceptance to Harvard to pile manure into a school gym?

These questions meant studying the roots of identity, and how a person could be at peace with being hateful and even dangerous. Now, decades later, an emerging explanation points to something more insidious than the possibility that someone simply identifies with a malicious group or blindly follows a toxic person. Instead, out of a basic need for consistency, we might take on other identities as our own.

“I have always been intrigued with the surprising things people will do in the service of preserving their identity,” says William Swann, a social- and personality-psychology professor at the University of Texas at Austin. He took up Lecky’s ideas and, in the 1990s, built them out into what he called self-verification theory. It asserts that we tend to prefer to be seen by others as we see ourselves, even in areas where we see ourselves negatively. As opposed to cognitive dissonance—the psychological unease that drives people to alter their interpretation of the world to create a sense of consistency—self-verification says that we try to bring reality into harmony with our long-standing beliefs about ourselves.

Swann’s theory offers an explanation for all sorts of seemingly counterproductive things that people do, from procrastination to poisoning relationships. Swann has noted that people with negative self-views tend to withdraw or flee from romantic partners who treat them too well. Some would call this “self-sabotage”—the basis for why some people ignore those who seem to genuinely appreciate them.

As Swann sees it, outwardly appearing self-injurious behaviors like these might actually be part of a fundamental “desire to be known and understood by others.” Self-views enable us to make predictions about our world and guide our behavior. They maintain a sense of continuity and order. Stable self-views also, ideally, help facilitate relationships and group dynamics. When people know their role in any particular dynamic, they predictably play the part, even when doing so is self-destructive.