The design of the car decides many things. For example, it is entirely possible (and desirable) to actually generate downforce just by going faster. This is called ground effect and in essence works by making the car low enough that air goes faster under the car and not over it, so Bernoulli's principle actually sucks the car to the ground rather than lifts it up. Some race cars in the 1960's and 70's actually added fans to the underside of the car to increase this effect. My personal favorite is the Chaparral 2J which had two engines, one to power the car and the other to power the fan. It's unfortunate they had a tendency to catch fire...
The overarching goal from generating downforce is to increase grip on the road. Of course, this comes at the cost of increased friction and aerodynamic drag. In fact, to improve overtaking in Formula 1 races, they introduced a rule in 2011 that allowed an adjustable rear wing so on straights the driver could lower the downforce generated by the rear wing to improve speed. But in turns, the wing would generate more downforce to keep the car stable. Also noted in the article is the balance in tire wear by adding force to the front or rear by a spoiler.
Another reason downforce is desirable is car stability. For a front engine car at low speeds, it is unlikely to exceed gripping strength of the tires. But at high speed, a front engine car will tend to over-steer because the back wheels will have less weight on them and tend to slip before the front. So in that case, a spoiler adds downward force on the rear tires and changes the steering characteristics. The same is true for front spoilers on mid- or rear-engine cars.
So, it is unlikely that cars actually generate lift when going faster. Very few will actually do that, and high speed cars actually tend to generate downforce just by the act of going faster. Spoilers, or wings, are added to improve certain characteristics of the vehicle, namely: tire wear, cornering and top speed.