When a car is found to be a total loss and the insurance company takes possession of the vehicle they normally sell it for parts, sell it to a junkyard for scrap or if it can be repaired sell it at an auction as a salvage vehicle.
If it is sold at an auction it will have a salvage title and in some states once the car has been repaired it will then get a rebuilt title to show that it is road worthy. If the car is sold to a junk yard it may be parted out or it may be crushed. It will depend upon the extent of the damages.
The monies the insurance company receives for the vehicle help offset the cost of the claim they paid out for the vehicle being declared a total loss.
In some states if you want to keep a car that has been totaled out you can buy it back from the insurer. It will have a branded (salvage title) now and you will be responsible for the repairs and making it roadworthy if you keep the car. It also may be more difficult to get insurance for it though insurance companies such as Progressive do insure salvage and rebuilt vehicles. Now when you buy it back the salvage value is taken out of your total loss settlement amount.
State laws and insurance company guidelines will dictate what an auto insurance provider would do with a totaled car. You can contact your state's insurance regulatory body for state law information and your auto insurance provider's agent for data on their internal guidelines.