How do auto insurance companies set my rate?

What makes you a better or worse risk than the average driver? Your age and gender. Your driving history and your car. Where you park and how far you drive to work. And on down the line, all the way to your profession, marital status and your credit history.