Huge chunk of the costs come from the fact that Doctors pay astronomical malpractice insurance rates in some states with no tort reform. Some have to spend more than 100k on insurance - 1/3 of their total pay. Since some states allows multi-million dollar judgments from juries that raises insurance everywhere, which raises not only prices for everyone but also dramatically contributes to more procedures and tests being done at even higher costs to avoid liability. The risks of having your entire livelihood wiped out chases out doctors from those states and reduces availability of care for patients as well. If you want objective cost comparison, compare Veterinary care which has similar consumables and training, but no insurance and liability impact on prices.
Maybe if we didn't have enormously expensive healthcare that is tried to our employers the payouts would need to be so huge. If I'm injured by medical malpractice and can't work I'm going to need a lot of money to make me whole in the US, even more so if I need additional medical treatment.
The money that goes to the injured is dramatically smaller than the money that everyone in the system pays to cover the insurance liability calculated insurance rates when the payouts can be arbitrarily set by juries. So if one jury says 600 million for one egregious case, all insurance for all doctors and all care for all patients skyrockets to trillions based on the risk assessment of insurers at that point. It is better to manage the risk with better measures (some states have a damage pool)
The doctor that delivered my middle child said he had to deliver three babies a week just to cover insurance, and he had never had a case against him in his decades of practice.