Stereotypes don't appear out of thin air, but they aren't independently formed either; they get taught and passed on by parents and peers. Confirmation bias also plays a role in perpetuating them too.
After all, if you hold the belief that women are bad drivers, did you independently come to this conclusion based on an accurate assessment of driving skill and gender, or did you hear "ha, women drivers!" over and over as a kid and subsequently see every mistake a woman driver made and mutter to yourself, "ha, women drivers!"?