Human adults are good at reading the minds of others to distinguish accidental from intentional behaviour. So are babies and animals, as Jason Goldman reveals.

Say I poured hot coffee all over you. After you got over the initial shock, and perhaps the second-degree burns, you would probably be pretty angry with me. But might your anger be diluted if I made it clear I spilled my drink on you out of clumsiness rather than malice? In either case, my actions would have been the same: my arm rotates my hand, the coffee escapes the mug and ends up on your newly-ironed shirt. Somehow, though, you can effortlessly distinguish between an accident and purposeful behaviour, and adjust your reactions accordingly.

As part of my column, I am exploring the abilities of our species, and those of our non-human cousins, to understand that others have beliefs, desires and intentions that differ from our own – known as "theory of mind". Last time, I looked at deception. Humans, chimpanzees, rhesus monkeys, ravens, and domestic dogs are able to make basic predictions about what others know. The ability to deceive relies upon being able to make assumptions about what others know – essentially a basic form of mind reading. This provides insight not only into others' knowledge states but also into their most likely behaviours. In short, they allow us to predict the future.

This skill rests upon our ability to infer the goals that underlie others' actions. And to do that, we need to be able to distinguish between accidental and intentional behaviour.

We humans attribute intention almost without thinking about it. Imagine, for example, a woman standing near a bank of lifts, raising her knee into the air. If her arms are holding a stack of books, you might infer that she is trying to press the call button with her knee. But if her hands are free, you might assume that she is simply stretching her leg. You are effortlessly able to interpret the woman's actions, and then evaluate the context to determine what the goal might be. By knowing her goal, you can make predictions about her later actions.

Still not convinced? Here's another example. Imagine you're an alien and during your first visit to Earth you encounter a group of humans playing the game bobbing for apples, in which participants attempt to retrieve a floating apple from a large tub filled with water using only their mouths. Surely, you might think, using their hands would be more efficient. Being an intelligent alien, you might infer that the humans' arms are paralysed, or that apples on Earth are for some reason harder to grasp with fingers than with teeth. Or that the players are washing their faces. If you keep watching, you might eventually come to understand the game, its rules and goal. As a result you could make educated guesses about the future actions of participants.

This is precisely the problem that humans solve every time we observe the overt behaviours of others. We have to read beyond the superficial properties of actions in order to understand goals and intentions.

Hands-free test

Human infants can do this too. Psychologists Gyorgy Gergely, Harold Bekkering, and Ildiko Kiraly, devised an experiment involving 14-month-olds sitting across a table from an experimenter. Between them was a light which could be turned on simply by tapping on it. The researcher began by leaning forward and tapping the light with her forehead. For half of the infants, her hands were clearly visible and free, while for the second group, they were holding a blanket around her shoulders. The infants in the first group imitated the researcher, using their foreheads to switch on the light, while most of the second group used their hands.

Even at that young age, human infants could differentiate between the woman's goal of turning on the light, and her action – tapping the light with her forehead. The first group reasoned that the women didn’t use her hands even though they were free, and therefore there must have been a good reason that she used her forehead, even if it wasn't obvious. The second group, however, simply figured she would have used her hands, if only she could.

It might seem impressive that human infants can reason about goals and intentions in such a sophisticated way, but they're not alone. Evolutionary anthropologists David Buttelmann, Malinda Carpenter, Josep Call, and Michael Tomasello carried out a similar study with chimpanzees. In the experiment, a human operated each of six different contraptions that activated either a light or a sound, in a surprising way, using his forehead, foot or by sitting on it. Half the time his hands were free, so he could have used his hands but instead opted not to. The rest of the time, his hands were visibly occupied, meaning that he couldn't have used his hands, even if he wanted to.

Like human infants, the chimpanzees precisely imitated the human's actions and used their heads or feet in cases when the human demonstrator's hands were free. But when his hands were occupied, the chimpanzees opted to use their hands instead. Like human infants, chimpanzees can distinguish between an action and its goal.

It isn't just apes, either. Rhesus monkeys and cotton-top tamarins were more likely to search for food in a container to which an experimenter had pointed than in a container towards which the experimenter had "accidentally" flopped his hand. And if the researcher used his elbow to point to a container, they only searched if his hands were otherwise occupied. If his hands were free, they did not interpret his elbow point as informative. Research with African grey parrots suggests that they, too, understand behaviour as goal-directed. They distinguish between humans who are unwilling to give them food from those who are simply unable.

A gazelle living in the African grasslands has just seconds to infer the actions of a stalking leopard, which meanwhile must quickly work to infer the escape trajectory of what it hopes will be its dinner. At first glance, this battle between the predator and prey might have little in common with my coffee spilling. Yet the complex human ability to judge the morality of actions rests on basic mindreading faculties that allow us and other animals to determine whether actions are intentional or accidental, and to use that information to predict future behaviour.

If you would like to comment on this article or anything else you have seen on Future, head over to our Facebook page or message us on Twitter.