This can be done at the very start of the grand prix, during the dash towards the first corner - or during the race itself. Although you will often hear talk of cars ‘overtaking in the pitlane’ (meaning a car gaining track position through a better pit stop compared to a rival) this is a matter of race strategy. Most people regard overtaking as meaning cars passing each other on the track, during the race.
This sort of overtaking is brought about by a speed difference: the car behind going sufficiently faster than the car in front to make a pass. The higher the speed difference, the easier the overtake. As Formula One cars are typically very closely matched on performance, certainly those likely to be in direct competition with each other, overtaking must be carried out with a very small difference in speed - requiring skill, commitment and courage.
One of the most important factors in Formula One overtaking is that of aerodynamic efficiency. As a car gets progressively closer to the rear of an opponent's car it moves into the 'bubble' of turbulent air being created. This has two effects, one positive and one negative. On straights this bubble gives what is known as a 'tow', slightly reducing the air resistance of the car behind and (all else being even) allowing it a slight performance advantage - hence the reason cars are often seen very close together just before an overtaking attempt.
The problem comes with the second aerodynamic effect, found in corners, where the reduced airflow acting on the wings of the second car will dramatically decrease aerodynamic downforce, and hence grip - meaning that the car behind will typically be forced to drop back, or to pick a different cornering line in 'clean air'.
Overtaking is not just about power, though. Often successful passing moves are made under braking - either at the culmination of a 'tow' into a corner, or simply because the car and driver behind have more braking power to call on. Similarly, if a driver has more grip to call on (or more confidence, in low-grip situations) then he may be able to overtake mid-corner by taking a radically different line to the car in front - often heading 'around the outside'.
In overtaking battles the driver in front's best defence is his ability to pick braking points and cornering lines. A skilful driver can hold off an opponent by adopting a 'defensive' driving style. Typically this means reducing the angle available for the car behind to use going into corners where there is a substantial risk of being passed. Providing that the driver ahead only changes his line once going into a corner (not deliberately attempting to block the car behind) this is a perfectly justifiable form of racing, and with it a driver in an inferior car can successfully hold off a faster rival. Narrowing the car behind's angle through corners can also force it to take a later apex and even run wide, even if it has successfully made the pass - and this can result in the slower car getting back in front again! A side-effect of this defensive driving is that it tends to slow both drivers down, which is why you often see these close battles dropping away from cars ahead.
How easy overtaking should be, and how much of it is required to make for competitive and exciting racing, is a topic of endless debate in Formula One circles. Recent consensus is that it is too difficult and that there should be more - hence moves by the FIA in 2009 to introduce KERS-powered ‘boost buttons,’ giving drivers additional bursts of power for short periods, and moveable front wings, allowing them to follow the car in front more closely without significant downforce loss.
A great overtaking move represents Formula One at its very best - a poor one can bring the sport into disrepute. It is a tribute to the incredible skill of modern drivers that they are normally able to race extremely closely and fairly without making contact, but event officials are always monitoring overtaking attempts, and any dangerous driving, whether attacking or defensive, will see the driver called before the stewards and penalised.
As only one driver can ever sit on pole position for a race, and the entire grid wants to finish on the top step of the podium, overtaking is of vital importance to the business of racing. Simplified to its most basic form overtaking is nothing more than gaining track position to get past an opponent.