The insurance company may have simply noted that, according to their data, women, on average, get into more motor vehicle collisions than men. In the simplest case, they could have just calculated the average number of motor vehicle collisions per insured person, stratified by gender. However, just because women, on a population-wide level, get into more accidents than men, does not tell us much about an individual woman's chances of getting into an accident. This is one of the central points of the court. As Michael notes below, this method is not designed to predict the outcome of an individual (unlike, for instance, the use of logistic regression or other predictive statistical models).
You might be interested in a paper by Kennaway that looks at the use of statistical trends to make predictions in a more mathematical manner:
A frequent use of statistical trends is to make predictions about
individuals. Aptitude tests and credit rating are two major
applications, especially in the latter case if ratings are derived
from rules generated from statistical analysis by data mining
applications. An individual to whom such tests are applied is, in
effect, participating in a lottery. If the test is valid, the lottery
is biased to a greater or lesser extent in his favour, but it is a
lottery nonetheless. Such tests say little about any individual being
tested.
He later states that:
The population relationship is a property only of the population, and
not of any individual in it.
I think this final point is important to keep in mind. It reminds us that in any population in which some population-wide relationship is measured, there will invariably be individuals who don't "fit the pattern", so to speak.