Squirrels juke at random when they get really scared. So do humans. If you're too close when they start that, there is a random chance of them jumping in your way no matter where you aim. Scaring them off before you get there is the best bet and swing to one side early does seem to prod them into the other direction. More often than not.
I've had worse luck with rabbits. Rabbits will make a B-line right at your wheel and if they're not going to make it, instead of changing their mind they just try to go faster. I hit one last month, or the other way around maybe. All I remember is seeing a tan streak shooting into the cone of my headlight from the left and then the handle-bars wrenching in my hands.