What deems a car totalled?
If the amount the insurance company has to pay to fix the car is greater than the market value of your car before the damage, minus the salvage value, it is a write off (totalled).
Say your car is worth 6,000 before the accident, and is now worth 2500 as salvage, this is a net cost to the insurer of 3500 to pay you out. So if the repair costs are 4000, it's a write off. if the repair costs are 3000, they will fix it.