But play isn’t just incompetent work; it also has special characteristics that let you distinguish it from the real thing. When rats play fight, they nuzzle each other’s necks; when it’s for real, they bite each other’s flanks. When children pretend to pour tea, they make big exaggerated sloshing movements.

Play is fun, even for animals. Babies giggle contagiously over peek-a-boo and rats laugh when they play fight, making a distinctive ultrasonic chirp.

Play is voluntary. It’s something that an animal does for its own sake, not because it’s instructed to do it or rewarded for doing it. In fact, young rats will actually work in order to get to play—they will learn to press a bar that lets them play. But play is not like other basic drives. Animals only play freely when their other basic needs are satisfied. When an animal is starved or stressed, play diminishes.

Play has a special structure, a pattern of repetition and variation. When rats play fight, they try different patterns of offense and defense against each other. When a six-month-old plays with a rattle, she tries shaking it louder or softer, banging it against the table with more or less vigor.

What does this distinctive activity do for animal minds and brains? Robotics may have an answer. Suppose you’re trying to make a robot that will be able to adjust to an ever-changing world, the way that animals and people do. What should you do?

Designing a robot that does just one thing, like walking, is relatively easy. Designing a resilient robot that can adapt to new circumstances is much harder. What happens if you turn the walking robot on its side, or even take off a limb? Living things can fluidly adjust to changes like these. Think about how a wounded soldier can learn to walk and even run on an artificial leg. But it’s much harder for robots.

The computer scientist Hod Lipson at Cornell gives his robots a chance to play—to randomly try out different movements and work out the consequences. A Lipson robot started out by dancing around in a silly, random way before it tried to do anything useful. But, afterward, it could use the information about its own body that it collected in the playful dancing phase to decide how to act when unexpected things happened. It could still walk even when the engineers removed one of its robotic limbs. That first apparently useless playful dance made the robot more robust later on.

The same picture emerges from studies of rat brains. Sergio Pellis and his colleagues compared rats who got a chance to play when they were pups, and those who didn’t. The play-deprived rats could perform the same actions as the other rats. But they didn’t know when to do what. Whether they were fighting or courting, they couldn’t react in the swift, flexible, and fluid fashion of the roughhousing rats. And their brains were less “plastic,” less able to rewire with new experiences.