Before answering your question, let’s discuss what function the windshield performs in cars and buses.
Windshields of cars and buses are made up of laminated safety glass to protect the vehicle’s occupants from flying debris like dirt, dust, insects, rocks, and also to provide an aerodynamically formed window towards the front.
Now coming to your question, as to why do cars have slanting windshields but buses don’t, the answer is related to the aerodynamics of the vehicles. The car windshields are slanting or tilted, to increase their air-drag, which is not needed in the case of buses as they have more powerful engines.
If cars’ windshields were flat, it would be very difficult for any car, making the engine work harder, which would require much more gas for the car to maintain speed. With a tilted windshield, the air flows up and over the car. Hence, a slanting windshield helps the car to cut through the air efficiently and smoothens its performance on roads.
In trucks and buses, on the contrary, very high speed is not as essential as the clear vision. Slanting windshields help a vehicle increasing its speed by cutting through the air but also cause visual distortion, which can create problems for truckers and bus drivers.
Also, the visual distortion is not much in cars due to their size being comparatively small. Had buses had slanting windshields, the distortion would have really caused some serious issues.