It really depends upon state laws and an insurance company's own internal guidelines what happens to a car once it is determined to be a total loss. In general though the insurance company will take possession of the vehicle at the time of the settlement with the car owner and then 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 from an auction, junkyard, etc help offset the cost of the claim they paid out for the vehicle being declared a total loss.
So state laws and insurance company guidelines will dictate what an insurance provider would do with a totaled car. For example in Illinois it depends upon how old the totaled vehicle is.
The IL DOI states that to minimize "chop shop" crime, Illinois law lets you keep a totaled vehicle only if it is nine years old or older, or if the vehicle has incurred only hail damage that does not affect the operational safety of the vehicle. In that case, your insurance company may, but is not required to let you keep your vehicle. If you have a newer vehicle, you must give the vehicle and clear title to your insurance company before they can settle your claim.
You can contact your state's insurance regulatory body for state law information and your car insurance agent for information on what their procedures are for regarding what they are allowed to do with a vehicle once they total it out and take possession.