They look at how much you could have gotten selling the car in the exact same condition in which it was just prior to the accident. Usually, this means going to a reference like Kelly Blue Book, but they can also look at more local indicators.
An insurance company will determine the value of a car depending on the year of the car, the make and model, and how many miles are on the car. As well as if the car has been in a previous accident.