A bird hitting a windshield is an extension of the superstition that a bird flying into a home is an omen of death. The superstition surrounding birds hitting car windshields is likely a recent evolution of this superstition because cars have only been common since the last half of the 20th century.
In folklore, birds are often otherworldly creatures that can cross between two worlds. This belief likely developed from the simple fact that birds fly, which makes them creatures of the heavens and leads people to believe that they have a direct connection to the culture's God or gods. This is also likely why several gods have been depicted as birds. The Egyptian gods Horace and Isis were both depicted as birds. The Norse god Odin is also depicted as a bird.
Superstitions like this one are ways of explaining odd or strange events that began during times when science was unable to explain them. Advancement in scientific knowledge, however, reveals that the likely reason birds crash into car windows is because they catch a glimpse of a reflection and assume it is another bird. It is, therefore, more likely that a bird attack on the window is a bird's way of making another bird leave its territory than a signifier of impending death.