insurance totaled car

How insurance companies determine the value of a car was?
Here is my situation. I wrecked my car a couple of days ago and the man who came to tow it told me said he believes that is a total loss. I'm crazy because I looked and saw Kelly BB two different prices for cars. Trade in value was 5000, while the retail value was 8000. If you only get 5000, you will pay 2000 more in the car to pay. Thus I wondered how insurance companies value the figure.
total loss evaluations are made by the guidelines established by the Department of State insurance. they can use various sources, nothing, Kelly, etc. autosource. to establish broad-based value for the vehicle, then a status report is made in your specific vehicle. If you have before the damage to your vehicle or excessive wear, damage is deducted from book value to determine the real value of your vehicle.
My totalled car.