If, as expected, Sebastian Vettel joins Ferrari he could emulate compatriot Michael Schumcher

How did it come to this?

The man most within Formula 1 acknowledge to be the best driver in the world should have been a natural fit with the sport's most famous team. Yet after five frustrating years, Fernando Alonso and Ferrari are divorcing.

And it is not as if Alonso has swapped his former dream partner for a younger, more attractive model, as he tried to do last season when he held serious talks with Red Bull, from where Ferrari have sourced his replacement in Sebastian Vettel.

Sebastian Vettel: Feels like right time to leave Red Bull

Alonso has lost faith in Ferrari's ability to deliver him the third title he so desperately craves. But the sport's most formidable - and demanding - competitor has apparently cast in his lot with another struggling team, McLaren, where he already has a painful history.

The fact that he appears to be going back to the team with which he spent such an acrimonious season in 2007 is a measure of how badly things have gone awry between Alonso and Ferrari.

Seven years ago, Alonso had a major falling-out with McLaren chairman Ron Dennis, and was instrumental - inadvertently, to a degree - in the team being clobbered with a $100m fine for the infamous spy-gate episode, when their chief designer was found to be in possession of confidential Ferrari technical information. The two parties split only one year into a three-year contract.

Vettel leaving 'emotional' for Horner

Clearly, though, Alonso felt he had no choice but to leave Ferrari, despite the team embarking on a major restructuring under new team principal Marco Mattiacci and their highly rated English technical director James Allison, who rates Alonso as the best driver on the grid and was at Renault when he won his two world championships.

With Mercedes and Red Bull not interested in signing him, Alonso was left with only one place to go, unless he wants to retire or take a sabbatical.

In this, Honda has been instrumental. The Japanese company, which is returning to F1 with McLaren in 2015, had tried to sign Alonso for its own team last decade, before quitting at the end of 2008. Finally, it seems Honda has got its man, at the cost of a reputed $50m (£32.3m), which would make him the best-paid driver in F1 by a long way.

Fernando Alonso Facts Nationality: Spanish Born: 29/07/1981, Oviedo Grand Prix debut: Australia 2001 Previous teams: Minardi, Renault, McLaren World titles: 2005, 2006 Career pole positions: 22 Career wins: 32

For all his frustration at Ferrari, Alonso will know that McLaren, chassis-wise, are in a much worse state this year - the Ferrari is quicker, at least in Alonso's hands, despite at least a 50bhp power deficit to the Mercedes engine McLaren will abandon in five races' time.

But having realised he cannot get a Mercedes engine, and believing Ferrari will not be competitive again in the near future, Alonso has decided his only chance to beat Mercedes is to bank on Honda getting it right, and on McLaren - in the midst of their own restructuring - sorting out their woes before Ferrari do.

On the face of it, abandoning Ferrari looks like a poor choice, but the same was said of Lewis Hamilton's decision to leave race-winning McLaren for struggling Mercedes at the end of 2012. And look how that turned out.

Alonso finished third in the Championship racing for McLaren in 2007

Equally, Ferrari insiders make no attempt to disguise how big their rebuilding job is, and talk privately about it being 2016 or 2017 before they can even hope to be properly competitive.

Alonso, at 33, realises time is beginning to run out on his career and felt he could not wait that long.

Vettel, on the other hand, can afford to do just that. He already has four titles in the bag, and at 27 has time on his side to invest in building a title-winning partnership with Ferrari, in much the same way as his compatriot and friend Michael Schumacher did 20 years ago.

Vettel has other reasons to leave the team that nurtured him from the age of 12.

Sebastian Vettel won four World Championships with Red Bull, making him the third most successful driver of all time

He has been overshadowed by his new team-mate Daniel Ricciardo to an extent no-one could possibly have imagined this season, the Australian winning three races to Vettel's none.

For now, Vettel's four titles have won him some currency and his reputation remains reasonably intact, but another year of being humbled by Ricciardo and he would not have much of a value left to put on the market.

His relationship with Ferrari goes back a long way, though. Italian sources close to the team have insisted for some years that there has been a long-standing agreement between Vettel and Ferrari that he would go there in the near future, despite repeated denials by Red Bull and Vettel of any such arrangement.

From Ferrari's side, they have wanted to action it before, but this was the first time it suited both parties. Once Alonso made clear his wish to leave, Ferrari were happy to let him go as long as they could secure Vettel.

Vettel has a much sunnier demeanour than the broodingly intense Alonso. That should not be taken to mean he cannot throw his weight around when he feels the need - as numerous stories from inside Red Bull attest - but he is far less likely to make the sort of pointed comments in public that have sometimes caused friction with Alonso.

Ferrari do not like to be criticised in public, and in that sense one imagines a far more harmonious relationship with Vettel than has been the case with Alonso.

Alonso the driver is virtually peerless. But outside the cockpit his skills have been lacking. For all his undoubted intelligence and cunning, Alonso has not exactly excelled when it comes to making career choices over the years.

British GP: Alonso and Vettel go head-to-head at Silverstone

At the end of 2007, he turned to his McLaren colleagues as he walked out for the last time at the final race of the season and admitted it had all gone wrong because he had "lost it" during the year.

Had he kept himself under control that summer, and calmed the situation rather than worsened it, he may well have won the title - and the following one in 2008 as well, given Hamilton's up-and-down season that year.

Likewise, when Alonso left McLaren, he chose to go back to Renault, knowing a Ferrari deal was waiting for him a couple of years down the line. At the time, Red Bull - then still 18 months from the first win - wanted him, too. But they were insisting on a two-year commitment and Alonso wanted to make only one, so he turned them down.

Now he has made another critical choice and already there are those who know him well - both his fortes and his foibles - saying this is another example of Alonso acting on bad advice from those closest to him, whether it be his father, his adviser Flavio Briatore or someone else.

How can he expect it to work, many wonder, going back to an uncompetitive McLaren, where Dennis is again a key figure?

Daniel Ricciardo has suprised everyone this season upstaging Sebastian Vettel in his performances

Alonso is a difficult and demanding character - some in F1 even say poisonous - and what he probably sees as requiring his teams to match the levels of effort and unstinting commitment he puts into his driving, some see as him being overly tough and unpleasant.

Dennis, although in many ways very different to Alonso, shares some of those characteristics. How can they not, many wonder, end up rubbing each other up the wrong way all over again?

But there is another potential end to this story. Perhaps, realising this is his last roll of the dice, Alonso will be different this time, aware that there is nowhere else to go, no other team who will have him.

With McLaren racing director Eric Boullier as a buffer between Alonso and Dennis - what the driver has been promised, I hear - perhaps the two men can rub along after all.

McLaren and Honda will not want for money and resources, and in Alonso they have a driver who can do things almost no-one else on the grid can.

If they worship him for that, and they each commit to each other, perhaps it will work after all.

If it doesn't, Alonso is likely to end his career with 'just' those two titles to his name, won long ago, when he emerged at the head of the new generation finally displacing Schumacher.

Sebastian Vettel celebrated his fourth drivers' world title in India last year by paying tribute to his car

In some ways, the numbers mean nothing. The consistent excellence of Alonso's performances over the years - his speed, his repeatedly breathtaking overtaking moves, his sheer, bloody-minded relentlessness, his forcing of uncompetitive cars into places they don't belong - has long since rendered irrelevant the statistical disparities between his career and, say, Vettel's.

But in other ways, especially to Alonso himself, the statistics mean a lot.

It is the fact that his hero Ayrton Senna won three championships that makes the number so important to him, so it is fitting that it is to the team with which Senna achieved his greatest success that Alonso now turns to achieve his own aim.

He admitted in a BBC Sport interview earlier this year that to end his career without winning another title would be "sad".

Given the level of his ability, it would be more than that; in many ways, it would be a travesty, one that meant when he looked back on his career there would always be regret mixed in with the justifiable pride.