When you are exposed to the sun , the sunglasses can protect your eyes from the UV rays which can gamage your cornea and the retina. It can also prevent the strong light which comes from every direction and glare from the surface, such as, water surface. You can stay focus straight ahead while driving because no other light can interrupt with your sight.
Ok, it seems that you are quite very informed of the advantages of wearing sunglasses on a sunny day or driving a car right? So, as you can see sunglasses are equipped some a pair of great lenses, which could resist strong lights and harmful lights, even radiation. So that our eyes could be better protected from sunshine or something light strong. On the other hand, some sunglasses, especially polarized ones, would help drives to resist some excessive lights such as reflective lights, thus, provide better driving and safety. Hope you find this useful.