When you get in an accident, you swap info and give the indo to the insurance company. When you get an estimate (good idea to go to the dealership, cause they overcharge) send it to your insurance company and they'll give you that amount. You then goto a cheaper place to get the car fixed and are able to spend the money you have left over.
OBTW, make sure you don't go to the dealership if you think the price to fix it might be over the book value of your car, then the title will be denounced as totalled.