Sitting on the M25, staring grimly at the surrounding traffic, you sigh. Late for work again ... and it seems to be getting worse. You know the stats: more than six billion people in the world today, increasing to nine billion by the middle of the century. The average speed of traffic through London is less now than it was in the days of horse-drawn carriages. You catch the end of a Radio 4 show - something about the threat of human extinction thousands of years ago. "Yeah right!" you think, looking out at the endless sea of cars. But the notion keeps coming back to you. Could it be true? If it is, what led us from endangered species to motorway mayhem in an evolutionary eyeblink?

Let me take you back through time. Back past the Beatles, Churchill, the Boer War (only 1.5 billion people alive), Krakatoa, the French revolution. At this point the world population is around a billion. You accelerate, back past the Norman invasion, Julius Caesar, the first farming communities. Here, about 10,000 years ago, there are only a few million people. Around 20,000 years ago there are no people in America; 40,000 years ago you notice a change in Europe - the Neanderthals are in charge. At 50,000 years ago Australia is part of an uninhabited continent. Before that (apart from the Neanderthals) you only find people living in Africa. Interesting. You head back to 100,000 years ago just to make sure. There seem to be more people - but still limited to Africa - and finally settle on 60,000 years ago as the low point. Then there were as few as 2,000 humans in existence. The worst time in the history of our species; one we nearly didn't survive.

But why were things so bad, and why does it seem to coincide with the time we left Africa to populate the rest of the world? Surely a species poised on the brink of extinction was not the obvious choice to create M25 gridlock within 2,500 generations?

We can probably blame much of it on the weather. Around 60,000 years ago the Earth was in the middle of an ice age, the effect of which was pretty chilling in the far north but in Africa it caused different problems. The ice sheets sucked up much of the world's moisture, causing widespread droughts particularly in Africa where the tropical latitude and intense sunshine, coupled with the lower moisture levels had a major environmental effect.

But our mass exodus from Africa was not only a matter of escape from bad weather; it was also about brain power. In many ways we are very much like our ape cousins, but we are different in a rather important respect - one that our species' Latin name sums up quite succinctly: we are Homo sapiens, or "wise man". Our brains define us as a species. How we came to have so much grey matter is a long story, and one that leads us even further back in time than our hardships on the African veldt 60,000 years ago.

Several recent discoveries have revealed ape-like creatures that could walk upright around 5m years ago. Perhaps the best documented is Ardipithecus, discovered in the 90s. Around the time of Ardipithecus it seems that some apes decided to walk around on two legs. This probably happened as a result of - wait for it - climate change. Africa went through a particularly bad drought around 6m years ago, which resulted in the drying up of the Mediterranean and seems to have set in motion some rather significant changes in the hominid - and ultimately human - lineage. Over time, these upright apes became completely bipedal, allowing them to see further and run faster, while leaving the hands free to do other things...which they started to do in earnest around 2m years ago when we see the first evidence of tool use by our ancestors. Homo erectus, the master toolmaker of the era, had a much bigger brain than his ancestors and developed many of the elements of modern human behaviour, probably including the use of fire and some form of rudimentary language. He even seems to have wandered out of Africa around 1.8m years ago - Java Man and Peking Man were both part of the Homo erectus family. He didn't stray far from the tropics, though (particularly when the world cooled down during the periodic ice ages), and was already on his way to extinction around 100,000 years ago.

After this change in abilities that led to the erectus African exodus, a long period of stasis seems to have set in. The hominids in the ensuing 1.7m years grew larger brains; several species appeared and then became extinct, and some even wandered out of Africa - giving rise to the Neanderthals in Europe about a quarter of a million years ago. During this time there were no big innovations. The tools used a million years ago in Africa do not differ much from those used by the Neanderthals 900 millennia later.

Then, about 60,000 years ago (give or take), something important happened in Africa - a sea change in human behaviour. Tools became much more finely crafted. They were made of materials like bone, which allowed the development of deadlier weapons. Group hunting methods became more efficient. Art also made an appearance -clear evidence that our ancestors were capable of abstract, contemplative thought. Overall, it really isn't hyperbole to talk about a "great leap forward" in mental abilities, to use anthropologist Jared Diamond's term.

What caused the great leap? Was it, as some researchers believe, a favourable mutation in a language gene - such as the recently described FOXP2 gene, implicated in some hereditary speech defects? The jury is still out, but recent studies suggest that complex characteristics (perhaps including modern syntactic language) can be created from pre-existing genetic variations. As conditions worsened during the ice age, our brains had to become better, and changes that favoured this would have been worth their weight in gold - or at least antelope meat.

The by-product of these changes was that we gained the skills to leave Africa in earnest: not the tentative stabs at Eurasia that had been made by our hominid ancestors, but a full onslaught. By looking at a combination of clues from the human genome and archaeology we can trace two routes - one along the southern coast of Asia, which reached Australia around 50,000 years ago. Another route, inland via the Middle East, would lead to the settlement of Europe by around 35,000 years ago and to the Americas (via the Siberian arctic) 20,000 years later. Along the way our ancestors encountered conditions that would test their abilities to the limit, but the great leap had given them the critical survival tools that allowed them to adapt. In the past 10,000 years alone we have evolved from conquering hunter-gatherers to today's frustrated commuter. Such is progress. Ultimately, the most amazing thing to come out of this research is the fact that the billions of humans alive today expanded from a small population living in Africa around 60,000 years ago. Effectively, we're all cousins separated by, at most, a couple of thousand generations. So the next time you're sitting in traffic, just blame the great leap. And try to remember that the driver in front is one of the family.

· Spencer Wells is former head of the population genetics research group at Oxford's Wellcome Trust Centre for Human Genetics