In standard personal auto insurance there are many factors that need to be taken into consideration. In general, if a person's car is totaled, there are a few points that need to be considered. At the end of the day, the specific outcome will come down to the actual policy in force as well as any of the endorsements on the policy. Please consider the following for a general answer, however:
If a car is totaled and the insurance company deems it is a fully totaled accident (or the police do) then the insurance company is responsible to step in. This is assuming you have coverage in place. However, if you do not have physical damage coverage on your car, then even if your vehicle is in an accident where you strike someone else, or the accident is deemed no fault, you could be without coverage. Physical damage is the coverage that allows for you to have your car restored to the value prior to the accident minus the deductible of course.
Another point to consider is if this is all due to an accident in the first place. If your car was damaged by someone else and you weren't even driving it, then it would be a comprehensive coverage issue. Again, a deductible would apply and you would need to ensure you have physical damage coverage in place.
Now to get into the specifics of who gets the payment, it really comes down to the listing on the policy. If a policyholder is involved in an accident where their vehicle is totaled, and you assume that they have no loss payee / lienholder, then the policyholder would still get all of the payout for the accident (or perhaps another car of equal value from the insurance company).
If the title holder or lienholder is different than the actual owner of the policy, this can present issues. Technically the lienholder is the one who actually "owns" the vehicle. Despite the private arrangements that have been put into place otherwise, the lienholder (if listed on the policy as such) can be the one that the insurance claim payments will go.
At the end of the day it is too hard to say what will happen without having additional information. This sounds like it would be something that an insurance adjuster would handle on a case by case basis. According to the most basic information, however, the claim payment will go to the lienholder / title holder of the vehicle as they are technically the "owners" of the vehicle.