They try to be stealthy and when the car is still going at them they run diagonally towards it, to make it turn and lose momentum. It's a good strategy vs bigger heavy predators, just not vs cars.
The reason rabbits and squirrels run into the car is because they assume it’s like other predators and not taking a path. Squirrels are trying to “juke” and anticipating that the car will respond to that.
I have to think that over time squirrels must be evolving due to cars. I do see dead ones, but I often see them running across the road, and notably not zigzagging. They still don't seem to have a sense of how close and how fast a car is moving though. I've seen a coyote not only assess the trajectory of my car, but change its mind about crossing the road in front of me once I demonstrated I had no traction in the snow.
Squirrels make a beeline for the nearest vertical surface they can climb and hide behind. This is what makes them dangerous to bicycles because they will run through wheels on their mission to get to the tree.
Prey animals are wary and startle easily to reduce their chance of becoming lunch.