Sebastian Vettel has won two of the three Formula 1 races so far this season

How have Ferrari done it? That is the big question on many people's lips in Formula 1 this year.

Sebastian Vettel is leading the championship by seven points from Mercedes driver Lewis Hamilton after two wins and a second place in the first three races. The German is giving every impression of being a serious title contender.

What a difference from last year, when Ferrari went winless, Vettel had a fractious relationship with his bosses and the big question was about whether the most famous team in F1 were disappearing into one of their periodic declines.

Vettel started 2017 with a win in Australia, took a close second to Hamilton in the second race in China and won again in Bahrain last weekend.

Mercedes appear to have a faster car over one lap (in qualifying, for example), but the Ferrari is very strong in races, particularly on the very softest tyres, which the Mercedes is over-heating.

Had the cards fallen differently, arguably either Vettel or Hamilton could have won any of the races. Which just underlines how close it is, and what massive progress Ferrari have made.

The title battle so far. Next stop: Russia

What are Ferrari saying about it?

Ferrari have been cautious in all their public pronouncements so far this season - to the extent that there is something of a media blackout, with even the drivers' news conference appearances significantly cut back. Team boss Maurizio Arrivabene has said almost nothing of consequence at all.

The idea, it seems, is to establish themselves in the season with as little pressure as possible.

When Vettel has spoken, he has not held back in his praise for the efforts Ferrari have made to turn their competitive position around.

"We did a massive stint over the winter," he said after his victory in Bahrain. "Last year was a very good year for us. It wasn't good in terms of results, don't get me wrong, but I think for the team, getting together, a lot of things that had changed now seem to start clicking.

"It helps when straight from the box, in testing, we had a good feeling. We looked reasonably competitive.

"Australia obviously was a massive boost for all the team. The whole factory has really come alive so that's great and we need to just make sure we keep it going.

"I'm really enjoying it; the car has been a pleasure. Things start to click and hopefully that sort of success now in the first couple of races helps us to build up some sort of momentum that maybe these guys [Mercedes] had in the past and the last couple of years. So they will be the ones to beat."

Ferrari have won more constructors' championships than any other team

What has happened behind the scenes?

Hard work is one thing. But all F1 teams work hard. Ferrari were working hard last year - and in 2014, when they also failed to win a race.

The explanation for the turnaround is more complex than that, and it starts a year or so ago, in the first difficult months of Ferrari's 2016.

Ferrari were confident heading into last year that they had further closed the gap on Mercedes after a 2015 in which Vettel won three races. The team bosses told president Sergio Marchionne as much, and he came out before the season started and said he expected Ferrari to be absolutely competitive from the off.

The problems started when they were not. Marchionne is an uncompromising Italian-Canadian businessman with a reputation as a hard man with colourful language. His nickname is "the jumpered assassin". He was not happy, and he wanted to know why performance was not what had been promised.

He began a full investigation into how things worked at Ferrari's Maranello factory. He personally interviewed many staff, not just the bosses, wanted to know their thoughts on why Ferrari could not compete with the best British-based teams, and asked for an explanation about why they had a reputation for lack of imagination and innovation in F1 design.

Marchionne decided the design department needed to be restructured, to free up some of the more creative minds and make a less top-down structure.

He identified, he has said, about 20 key "high-potential individuals" to promote and harness. Management was reorganised; the format of meetings, too.

The idea was to make design more flexible, to ensure all ideas were discussed and make the group more open to suggestions. And to encourage a greater sense of ownership and responsibility among a much wider array of people, to avoid the usual Ferrari problem of people keeping their heads down so they could not be blamed for failure.

At the same time, Ferrari undertook an analysis of their weaknesses and concluded three main issues - aerodynamics, especially on circuits that require efficiency, such as Barcelona and Silverstone; tyre management; and gearbox fragility.

That done, they had a redefined baseline focus for 2017.

Is this really James Allison's car?

Sebastian Vettel is in his third season with Ferrari

This restructure took place in the summer of last year. A major part of it was the departure of former technical director James Allison - fundamentally because of a disagreement with Marchionne on details of the restructure - and his replacement by former engine boss Mattia Binotto, who had a reputation as an excellent engineering manager.

F1 cars are a long time in gestation. Even in a normal year, layout is being done in the spring of the previous season. When there has been a big regulation change, as there has been this season, design work starts much earlier. Most 2017 cars have been at least two years in the making.

The teams knew the fundamentals of the 2017 rules as long ago as the summer of 2015 but the regulations were not finally signed off until early March 2016. At the very least, the fundamental concept of this year's Ferrari - its wheelbase, dimensions, basic aerodynamic philosophy and so on - was done on Allison's watch.

He and former aerodynamic head Dirk de Beer left at the same time last July and are now ensconced at other teams - Allison as technical director of Ferrari's title rivals Mercedes; De Beer, who also worked with Allison at Lotus, at Williams.

Other star cars: The Ferrari 156 'sharknose'. Probably the most romantic and evocative F1 car design ever. It won the title in 1961

So Allison, who is one of probably the top two most highly rated design leaders in F1, was at Ferrari for all but the final five or six months of the creation of this car. Clearly, his contribution to it was significant, even if he played down his influence when asked in Bahrain last weekend.

"I left Ferrari many months ago," Allison said, "and joined Mercedes just some small number of weeks ago. And anything that Ferrari has done for this year's car is a credit to the people that work at Ferrari over these months and what they have delivered."

Ferrari have, though, made progress since Allison departed. The car features a number of innovative design interpretations, and it surely cannot be an accident that this has happened in the first season after they restructured the design department with the express intention of being less conservative.

As ever when a team makes a big relative step forward like this, the paddock is a hotbed of rumour as to what they might have done.

Other star cars: The 312T, which won the constructors' title four times. Despite having an airbox like a hairdryer. Very... '70s

People are talking about Ferrari having found a way to make the floor flex for aerodynamic advantage - in a similar way to that in which Red Bull were so successful in the early 2010s. Theoretically, this is not allowed, but everything flexes a bit, and there are load tests conducted by governing body the FIA. As long as a car passes these, it is legal.

Rivals also say that a significant chunk of Ferrari's pace has been down to major progress with the engine. Vettel confirmed this in Bahrain when he said: "We did a very, very good job, especially on the engine side. I think there's been a very big step so it feels great, feels like a lot more power than last year."

Again, there are rumours, this time about fuel additives to make a bigger combustion bang and therefore more power. Again, the FIA does checks and everything has been found to be above board.

The unanswered question so far is whether Ferrari can keep up in the development race, a weakness so far this decade.

What is good about Ferrari's car?

The sidepods are the most obvious indicators of Ferrari's design innovation

Ferrari's design innovation this year is most obvious around the front of the sidepods, the bodywork that sticks out either side of the cockpit and which house radiators and other ancillaries.

This area is unique - the sidepod air inlets are much higher and shallower than on other cars, and feature unusual airflow shapers at their front. The benefits are that the air has a cleaner route into the sidepods and there is more space under the inlets, through the cutaway section below, for the crucial downforce-defining airflow to the rear.

The result has been a car Vettel is actively enjoying driving, one that suits his driving style, unlike last year.

Vettel is a great driver, but he needs a car to behave in a certain way to be at his best. If a car won't do what he wants, he can get into a downward spiral, as happened last year and in 2014, his final season at Red Bull.

Vettel likes consistent and predictable rear grip on corner entry, so as to enable him to rotate the car early in the corner, get on the power early and therefore increase speed down the following straight.

It was a technique that worked to perfection in the Red Bulls he drove to four world titles, and it is working again this year. The downforce created by Ferrari's innovative design under new rules aimed at making the cars faster and more demanding has been crucial in creating this balance for Vettel.

Team-mate Kimi Raikkonen, meanwhile, is struggling, his pace affected by a lack of front-end grip, which has always been his biggest Achilles' heel, and which does not bother Vettel in the same way.

Other star cars: The F2004 saw Michael Schumacher at his most dominant, sewing up the 2004 title about halfway through the season

What does it all mean?

Ferrari's strong start to the season led to the first sign that their ultra-cautious approach is starting to peel away and their self-confidence is growing. Following Vettel's victory in Bahrain, Ferrari put out a statement from Marchionne.

"It is, of course, hugely satisfying to be back on the top step of the podium with Seb," he said. "More importantly, however, we are now completely confident that our victory in Melbourne wasn't just a one-off and that we will be at the forefront of this world championship until the last.

"We finally have a competitive car to count on and it is important to recognise the speed with which we implemented the developments demanded for each new race.

"All this is the fruit of superb work at the track and in Maranello, so my compliments not just to Seb for his achievements in Bahrain, but also to the whole team.

"That said, we are well aware we have a long road ahead and know that if we want to get to the most important finish-line of all, we cannot stint on our commitment and focus for a second."

Ferrari's performance is not just good for Ferrari, though; it is good for F1 as a whole.

For the new owners, ensconced only in January, it has given a superbly exciting championship battle to sell to the world.

Ferrari's success may, however, complicate negotiations over the teams' new contracts post-2020, which are already starting.

Ferrari's historic value means that under the current deal they are given 5% of F1's total revenues (which are about $1.5bn, so that's $75m) before the prize money is distributed - plus another $120m or so from the prize fund. Cutting that as part of a more equitable income distribution to the teams won't be easy when Ferrari's value as a stop on Mercedes' domination is so clear.

Beyond the arcane finances of F1, though, most importantly it means that in an era of falling television figures and questions about F1's appeal to a younger generation, two of the greatest drivers in the world are fighting for the title while racing for two of the biggest names in the automotive industry.

On every level, that's good for everyone who has even a passing interest in the world's biggest annual televised sport.