Typically, an insurance company determines that a car is totaled by comparing the ratio between the repair cost and the cash value of the vehicle to limits on internal rules or state law. If the repair cost exceeds the vehicle's value, the car is automatically totaled.
Insurance companies may decide to total a car when its impractical to repair the car, even if the repair costs are below the car's value. That's why older cars or vehicles with lower resale value are more likely to be totaled for the same amount of damage.
The purpose of totalling a vehicle is to save insurance companies money. It is cheaper to pay the owner the cash value of the vehicle and have the owner purchase a new car than it is to cover the cost of repairs.