Does anyone know definitely what is required for a racing game to feature specific cars? Do they have to pay for the right to use the car? Are the car manufacturers donating them for publicity? Why do some games have different cars than others?
It varies from manufacturer to manufacturer.
When gaming was still young and growing, pretty much any initiative to license any car, for a game, had to come from the developers or the publisher, because manufacturers didn't really see the appeal of videogames, not only because those who played them were mostly too young to even buy their products, but also because the digital representation of their products were a far-cry from the real deal.
Nowadays, we've reached near photorealism, graphically, and the increased processing power, of modern hardware, allows for complex and detailed simulations of car behavior, that let you feel the unique handling characteristics of each different car. Then, there's also the advancement in control interfaces, with amazing steering wheels, pedals and shifters that help raise the gameplay experience to a point close enough to actually sitting in the real car. Because of all these advances, and the fact that the gaming world has become a lot more mature, with a lot of the people playing actually capable of buying a car for themselves, manufacturers are seeing an almost direct line of advertisement to their potential consumers. A line of advertisement that allows their product to be put into the hands of millions, with incredible fidelity to the real thing, at comparatively low costs and effort on their part. So, what happens now is some manufacturers actually take the initiative in contacting and partnering with game developers to have their products prominently featured, while others still require persuasion, the old fashioned way.
Concluding, both things happen. Sometimes you have to go to the manufacturer, sometimes they come to you.