I think the link in LeeG's reply covers all the necessary steps but just to have it spelled out here.
Good surface prep is very important, imperfections 'telegraph' through paint very easily so the more perfect you can get the surface initially the better. The flatter the starting surface the less paint you have to use too, so it does have both time and cost benefits.
Build up of colour in multiple layers. Just as with most painting and varnishing multiple thin coats are better than one thicker coat.
Flattening off using a sanding block to maintain a good flat surface. Special care must be taken at edges and corners as it is very easy to sand through to the primer coat.
Final smoothing by wet-sanding to a very high grit, while still striving to keep the surface flat; it is possible to introduce waves and other dips into the finish even after switching to very fine grits.
Polishing. This can be achieved in any number of ways, from the old traditional methods used in furniture finishing such as using powdered rottenstone lubricated with a light oil or water, to modern cream polishing compounds and powered rotary polishers.