Bill Gates is the richest person in the world. At the age of 19, he dropped out of Harvard to start Microsoft, and in a few short years he made it the most profitable corporation in the world. It’s tempting to think that he must be one of the smartest people who ever lived.

Gates is undoubtedly extraordinarily bright. But his pre-college life was blessed, computationally speaking. He was bored at his Seattle school in eighth grade in 1968, so his parents switched him to a private school that happened to have a terminal linked to a mainframe computer. Gates became one of a small number of people anywhere who had substantial time to explore a high-powered computer. His luck continued for the next six years. He was allowed to have free programming time in exchange for testing the software of a local company; he regularly sneaked out of his house at three in the morning to go to the University of Washington computer centre to take advantage of machine time made available to the public at that hour. It is unlikely that there was another teenager in the world who had the kind of access to computers that Gates had.

Behind many a successful person lies a string of lucky breaks that we have no inkling about. The economist Smith has twice as many publications in refereed journals as the economist Jones. We’re naturally going to assume that Smith is more talented and hardworking than Jones. But as it happens, economists who get their PhDs in a “fat year”, when there are many university jobs available, do much better in the academic job market and have more successful careers than economists who get their PhDs in a “lean year”. The difference in success between Smith and Jones may have more to do with dumb luck than with intelligence, but we’re not going to see this.

The careers of many college students who got their degrees during the recession are going to be forever stunted. Unemployment is bad not just because it’s demoralising not to have a job, but because the repercussions may never cease. Parents are going to wonder where they went wrong with struggling Jane, who graduated from college in 2009, and what they did that was so different from how they brought up successful Joan, who graduated in 2004.

It is unlikely that another teenager in the world had the kind of access to computers that Bill gates had

Important influences can be hidden, but even when powerful situational determinants of behaviour are staring us in the face, we can be oblivious to their impact. In a classic experiment from the 1960s, the social psychologists Edward Jones and Victor Harris showed people one of two essays about Cuba’s political system allegedly written by a college student in response to a requirement by a professor. One essay was favourable towards Cuba and the other was unfavourable. The experimenters informed the participants who read the essay favourable to Cuba that it had been written as an assignment: an instructor in a political science course required the student to write a pro-Cuba essay. The experimenters told other participants that the student who wrote the unfavourable essay had been required to write an anti-Cuba essay. I think we can agree that the participants had learned nothing about the students’ actual attitudes toward Cuba. Yet the participants rated the first student as being substantially more favourable to Cuba than the second student.

In everyday life we ignore equally powerful influences on people’s behaviour. Whether you’re heroic or heartless may depend on a contextual factor whose impact is far greater than we would tend to assume. The social psychologists John Darley and Bibb Latané conducted a series of experiments studying what has come to be known as “bystander intervention”. They contrived a number of situations that seemed like emergencies – an epileptic seizure, a bookcase falling on a person in an adjacent room, someone who fainted on the subway. The likelihood of a person offering help to the “victim” was hugely dependent on the presence of others. If people thought they were the only witness, they usually attempted to help. If there was another “witness” (actually a confederate of the experimenter), they were much less likely to help. If there were many “witnesses”, people were quite unlikely to offer help.

To drive home the point that kindness and caring can be less important than situational factors, Darley and his colleague Daniel Batson conducted a study with theological students – people we might assume would be particularly likely to help someone in need. The researchers sent a number of Princeton theological students to a building across campus to deliver a sermon on the Good Samaritan, telling them the route to follow. Some of the students were told they had plenty of time to get to the building and others were told they were already late. On their way to deliver the sermon, each of the seminarians passed a man who was sitting in a doorway, head down, groaning and coughing and in obvious need of help. Almost two-thirds of the seminarians offered help to the man if they were in no rush. Only 10% offered help if they were late.

Lucky break: Bill Gates, the richest person in the world, had a blessed pre-college life.

Of course, if you knew only that a particular seminarian helped and another one didn’t, you would have a much more favourable impression of the one who offered assistance than of the one who didn’t. A circumstance like being in a rush wouldn’t be likely to occur to you as a factor influencing the seminarian who failed to be a Good Samaritan. And in fact, when you describe the experimental setup to people, they don’t think that the situation – being late versus not – would have any effect at all on whether the seminarian would help or ignore the person in distress. Given this belief, they can only perceive failure to help as being due to poor character, something internal to the person.

The “fundamental attribution error” gets us in trouble constantly. We trust people we ought not to, we avoid people who really are perfectly nice, we hire people who are not all that competent – all because we fail to recognise situational forces that may be operating on the person’s behaviour. We consequently assume that future behaviour will reflect the dispositions we infer from present behaviour. (It’s past behaviour over the long run, observed in many diverse situations, that is the excellent predictor, not behaviour observed in only a few situations, especially a few situations all of the same type.)

A few years ago a graduate student who was working with me told me something about himself that I would never have guessed. He had done prison time for murder. He hadn’t pulled the trigger, but he had been present when an acquaintance committed the murder, and he was convicted of being an accessory to the crime.

My student told me a remarkable thing about the murderers he met in prison. To a man, they attributed their homicides to the situation they had been in. “So I tell the guy behind the counter to give me everything in the till and instead he reaches under the counter. Of course I had to plug him. I felt bad about it.”

There are obvious self-serving motives behind such attributions. But it’s important to know that people generally think that their own behaviour is largely a matter of responding sensibly to the situation they happen to be in – whether that behaviour is admirable or abominable. We’re much less likely to recognise the situational factors other people are responding to, and we’re consequently much more likely to commit the fundamental attribution error when judging them – seeing dispositional factors as the main or sole explanation for the behaviour.

If you ask a young man why he dates the girl he does, he’s likely to say something like, “She’s a very warm person.” If you ask that same young man why an acquaintance dates the girl he does, he’s likely to say, “Because he needs to have a non-threatening girlfriend.” When you ask people to say whether their behaviour, or their best friend’s, usually reflects personality traits or whether their behaviour depends primarily on the situation, they’ll tell you that their friend’s behaviour is more likely to be consistent across different situations than their own is.

The main reason for differences in the attributions actors and observers make is that the context is always salient for the actor. I need to know what the important aspects of my situation are in order to behave adaptively (though of course I’m going to miss or ignore many important things). But you don’t have to pay such close attention to the situation that I confront. Instead, what’s most salient to you is my behaviour. And it’s an easy jump from a characterisation of my behaviour (nice or nasty) to a characterisation of my personality (kindly or cruel). You often can’t see – or may ignore – important aspects of my situation. So there are few constraints on your inclination to attribute my behaviour to my personality.

Killers attribute their crime to the situation they were in. ‘Of course I had to plug him. I felt bad about it’

People who grew up in western culture tend to have considerable scope and autonomy in their lives. They can often pursue their interests while paying little attention to other people’s concerns. People in many other cultures lead more constrained lives. The freedom of the west begins with the remarkable sense of personal agency of the ancient Greeks. In contrast, the equally ancient and advanced civilisation of China placed much more emphasis on harmony with others than on freedom of individual action. In China, effective action always required smooth interaction with others – both superiors and peers. The differences between west and east in degree of independence versus interdependence remain today.

One of my favourite experiments, conducted by the social psychologist Takahiko Masuda, asks Japanese and American college students to rate the expression of the central figure in a cartoon where he is surrounded by other faces [see the Observer Magazine’s own version on page 21). Japanese students rate the central figure as less happy when he’s surrounded by sad figures (or angry figures) than when he’s surrounded by happier figures. The Americans were much less affected by the emotion of the surrounding figures. (The experiment was also carried out with sad or angry figures in the centre and with happy, sad, or angry faces in the background, with similar results.)

The differential attention to context results in easterners having a preference for situational explanations for behaviour that westerners are more likely to explain in dispositional terms. Easterners are susceptible to the fundamental attribution error – just not as susceptible as westerners. For example, in a study similar to the one by Jones and Harris demonstrating that people tend to assume an essay writer holds the opinion required by the assignment, Incheol Choi and his co-workers showed that Korean participants made the same mistake as Americans. But when participants were put through the same kind of coercive situation as those whose essays they were about to read, the Koreans got the point and didn’t assume that the writer’s real attitudes corresponded to their essay position. Americans, however, learned nothing from having the situation made so obvious and assumed they had learned something about the essay writer’s opinion.

Easterners tend to have a holistic perspective on the world. They see objects (including people) in their contexts, they’re inclined to attribute behaviour to situational factors, and they attend closely to relationships between people and between objects. Westerners have a more analytic perspective. They attend to the object, notice its attributes, categorise the object on the basis of those attributes and think about the object in terms of the rules that they assume apply to objects of that particular category.

There is vastly more going on in our heads than we realise. The implications of this research for everyday life are profound. Firstly, we should pay more attention to context. This will improve the odds that we’ll correctly identify situational factors that are influencing our behaviour and that of others. In particular, attention to context increases the likelihood that we’ll recognise social influences that may be operating. Reflection may not show us much about the social influences on our own thinking or behaviour. But if we can see what social influences might be doing to others, it’s a safe bet we might be susceptible as well.

Secondly, we should realise that situational factors usually influence our behaviour and that of others more than they seem to, whereas dispositional factors are usually less influential than they seem. Don’t assume that a given person’s behaviour in one or two situations is necessarily predictive of future behaviour. And don’t assume that the person has a trait or belief or preference that has produced the behaviour.

And finally, realise that other people think their behaviour is more responsive to situational factors than you’re inclined to think – and they’re more likely to be right than you are. They almost certainly know their current situation – and their relevant personal history – better than you do.

Mindware: Tools for Smart Thinking, is published by Allen Lane on 18 August. To order a copy for £16 go to bookshop.theguardian.com