Playfulness is what makes us human. Doing pointless, purposeless things, just for fun. Doing things for the sheer devilment of it. Being silly for the sake of being silly. Larking around. Taking pleasure in activities that do not advantage us and have nothing to do with our survival. These are the highest signs of intelligence. It is when a creature, having met and surmounted all the practical needs that face him, decides to dance that we know we are in the presence of a human. It is when a creature, having successfully performed all necessary functions, starts to play the fool, just for the hell of it, that we know he is not a robot.

I was once in the south-eastern Sahara, in Algeria, near the border with Libya, near a settlement called Djanet. There’s a range of mountains there called the Tassili n’Ajjer: bone dry, a thousand square miles of treeless rock. A few millennia ago before the climate changed, this was a fertile region where big game roamed and African bush people lived and hunted. They lived in caves and beneath big overhangs of rock. At night they painted scenes from their lives and their fantasies, daubed in black and ochre on the walls and ceilings. There are hundreds of such sites, many more still doubtless undiscovered, scattered through these mountains.

With my fellow expeditionaries, I stood beneath one of these overhangs, admiring the fine artwork, the beautiful lines of giraffes, buffaloes, gazelles and birdmen . . . you could usually recognise at once what was being depicted.

But one set of paintings – if you could call them that – defeated us. Across part of the rock ceiling was a series of five-dot clusters. The dots were of red ochre and simply crude blobs, varying in size but mostly a bit smaller than a penny. There were usually five, some blobs firmer than others, in nothing that looked like the shape of anything. We puzzled and puzzled.

Then – “Of course!” one of my comrades exclaimed. “Look!” And he jumped from the earth floor as high as he could, one hand above his head. His fingers, stretched up, could just touch the rock above. And we saw at once that if he’d daubed them in paint, the fingers and thumb would have left five blobs just like the ones we had been puzzling over.

All at once, it was clear. The bush people, lounging about after dark in their family shelter, perhaps around a fire – basically just hanging out – had been amusing themselves doing a bit of rock art. And perhaps with some leftover red paste, a few of the younger ones had had a competition to see who could jump highest and make their fingermarks highest up the overhang.

This was not even art. It called for no particular skill. It was just mucking about. And yet, for all the careful beauty of their pictures, for all the recognition of their lives from the vantage point of my life that was sparked in me by the appreciation of their artwork, it was not what was skilful that brought me closest to them. It was what was playful. It was their jumping and daubing finger-blobs competition that brought them to me, suddenly, as fellow humans across all those thousands of years. It tingled my spine.

Caprice. Frolic. Joke. Jest. Dance. This is the word cloud that takes me to what makes us human. The great German philosopher Friedrich Nietzsche said this: “. . . one must still have chaos in oneself to be able to give birth to a dancing star”. It is the chaos in ourselves that is divine. We can be trained to do almost anything, harnessed to almost any purpose. But there remains a wayward spark whose unpredictability lies in the fact that it is pointless. That is humanity.

An age is coming when machines will be able to do everything. “Ah,” you say, “but they will not be conscious.” But how will we know a machine is not conscious – how do we know another human being is conscious? There is only one way. When it starts to play. In playfulness lies the highest expression of the human spirit.

Matthew Parris’s latest book is “The Spanish Ambassador’s Suitcase” (Penguin, £9.99). This article is part of our series published in association with Radio 2’s Jeremy Vine show