In my humble opinion, this is why it costs so much.
I agree - that is a LOT of it.
But BECAUSE of that - doctors and hospitals are complicit in it too. How much will insurance cover? What's the maximum they will pay? Amazing - that EXACTLY matches how much I charge my patients. Until next year when you cover more - then it will be exactly the same then, as well.
You go to your doctor - and he's - not so sure - better order a test. Or three. Or ten. They're all covered by insurance so everyone's happy. You look at the EOB and see, wow, I didn't pay for any of these tests. But if I didn't have "insurance", I'd have paid 5000 bucks.
Doctor is worried about you - so he says, come back in, in two weeks, and then a month, for follow-up. Follow up.
See, if he were a tech company, "follow up" means it's on HIS dime; it's part of the process. Not here - insurance covers most and you STILL pay the co-pay.
What you alluded to also - pills cost a lot to research and test, and Americans foot the bill for the world.
Worse, they cost a lot for a lot of reasons, not the least of which is - they lose money on stuff that doesn't pass. And a lot doesn't.
Then, there's the entire insurance health care industry that has made it necessary to hire whole legions of medical professionals to figure out billing.
Used to be, you went to the doctor and he billed you. Hell no. He now has several staff to process insurance, because they're all different and heck, they're different even from state to state.
On and on and on. The whole health care/"insurance" idea has seeped into everything. It's not "insurance" really, because most insurance models balance their costs against risk.
The riskier you are, the more you pay. Show less risk - by having a clean driving record, for example - and you pay LESS. Life insurance? If you're older, you pay MORE.
That's the way it works.
Since we are all appalled at the idea of sicker people having to pay more - we don't do that as much anymore. But every finger the government sticks in drives it up further and we NOW have a situation where health care costs SO MUCH that it is utterly unaffordable by almost EVERYONE unless you DO have insurance. But the richest don't need to buy it at all - they can afford health care at any price. The poorest can't afford any of it - so they get it for free, albeit at a lower quality.