Fraud happens uncomfortably often — from financier Bernie Madoff to the (now imprisoned) real-estate developer who built the outsized house, recently foreclosed, in my neighbourhood. But it disturbs most when it happens close to our professional home.

Diederik Stapel, a social psychologist and author of many published papers, has resigned his position at Tilburg University in the Netherlands after admitting to fabricating data in his research (see Nature 479, 15; 2011). I know Stapel through limited interactions at conferences, and he won the Early Career Award from the International Society for Self and Identity when I was its president in 2007.

He published his findings in several journals of the American Psychological Association, for which I am chair of the Publications and Communications Board. The association, and other publishers, will retract any fraudulent works that the investigation identifies. The early signs are that the scale of his fraud is vast.

Such cases of outright fraud in science are distressing for many reasons. For example, they damage the careers of students and collaborators, and raise doubts about all papers by the same author. Most importantly, they damage public trust in science and in scientists. In this case, trust in social psychologists, and the work we do, has been undermined.

How can it happen? Why would someone with obvious intelligence, ambition and talent risk everything by falsifying data? Social psychology offers us a way to answer such questions.

To understand fraud, we should think about how it begins and escalates, not how it ends. By the time such fraud is exposed, bad choices that would usually lead to only minor transgressions have escalated into outright career-killing behaviour.

Stanley Milgram's 1963 classic studies of obedience to authority help to show why people do things that are highly counter to their norms. Milgram's studies are usually interpreted as providing insight into how situations determine behaviour. Another lesson of his experiments is how easy it is to take the first small step on the slippery slope that ends with violation of our norms and values, and how hard it is to stop.

In Milgram's study, research participants were told to administer escalating electric shocks when actors answered questions incorrectly. The work is famous because of where it ended. More than half the subjects were willing to administer shocks beyond the point at which the 'learner' complained of heart pain and then stopped responding. The lesson of the study seemed to be that people would violate their own moral codes and administer potentially deadly shocks on the say-so of an authority figure.

But look at where the experiment begins. Every one of the participants started by giving only a 'slight' shock of 15 volts in response to the learner's first incorrect answer. With assurances from the supervising experimenter that the shock might be painful but was not dangerous, what could be the harm?

A heavy focus on fraudsters may also conveniently divert our attention from the fraudster within us all. ,

The harm is that once people have delivered 15 volts of shock, they have no compelling reason to resist 15-volt increases. After all, they have implicitly conceded that 15 volts of shock is minor. Each time participants administered an increased shock, that level of shock became the new normal. Consciously or unconsciously, they justified their behaviour to themselves every time they pulled the switch, and every justification made the next pulling of the switch easier.

To understand fraud in science, the useful lesson is the significance of that first tiny step. Every minor transgression — dropping an inconvenient data point, or failing to give credit where it is due — creates a threat to self-image. The perpetrators are forced to ask themselves: am I really that sort of person? Then, to avoid the discomfort of this threat, they rationalize and justify their way out, until their behaviour feels comfortable and right. This makes the next transgression seem not only easier, but even morally correct.

The well-being of science and our society requires that fraud be punished severely. But a heavy focus on fraudsters may also conveniently divert our attention from the fraudster within us all. Who cannot find places where they took a first step, or perhaps several steps, down one slippery slope or another? The road to fraud probably starts out with a step taken because of some egotistical fear or anxiety — fear of losing someone's respect, for example, or of letting others down, the fear of being seen as a loser, of being a failure, or of not getting the job, the grant or the award that one covets.

In such circumstances, the difficult question then becomes, how can we stop the slide? In the case of the '15-volt' steps towards scientific misconduct, thinking about the consequences for our students, colleagues, loved ones, our institution, our discipline or science itself might halt our own little slides. In this regard, we should all admire the colleagues and researchers who took the risk to stop something unacceptable when they saw it in the Stapel case. Surely, they too experienced egotistical fears. Will people believe me? What will happen to me? Will my own reputation be tarnished?

The slippery slope beckoned, but they acted for the common good, and we should thank them.