Healthcare billing is WAAY more complicated than a reasonable-length post here could describe. It's full of "you're kidding me!!" realities. Some quick ones: insurance often pays via a "percent of billed charges": they'll negotiate to pay, say, 50% of the hospital/provider's usual and customary rate. Sounds impressive! Then the hospital/provider sets the rate pretty high. Who wouldn't, in that situation? By contrast, Medicare/Medicaid/TRICARE all use fixed rates set by the government. And self-pay? Believe it or not, they're expected to pay that "usual and customary" rate, with some relatively minor discounts offered for prompt pay, etc. The latter is driven by car insurance regs: insurers didn't want to pay one price for body work while someone else walking in and paying out of pocket pays a rate a fraction of that.
So, three people walk into an ER with headaches all requiring an MRI. Just for the MRI (not the ER visit, meds, etc.), the one with insurance may get charged $5,000 for the MRI but their insurance has negotiated that down 50%, so the insurance pays $2,500 and the patient pays whatever copay/cost share they may have (zero to whatever dollar/percentage).
Second patient has no insurance and is billed for the $5,000 and is expected to pay it. A week later they go negotiate with the billing people and get a 30% discount for prompt payment or something else the hospital has creatively developed which allows them to legitimately offer a discount. They either pay that $3,500 eventually or the bill goes to collection, where maybe months or even years later it gets negotiated down further or written off as bad debt.
The third patient is on Medicare. The hospital bills $5,000 and Medicare says "that's interesting. We reimburse $200 for that". And the hospital takes it. And the patient pays whatever copay/cost share their Medicare supplement (if any) tells them to. But it's not for the $4,800 difference; the hospital can't "balance bill" for that. If a hospital chooses to accept Medicare patients, they are required to accept Medicare payment rates.
Want your head to spin some more? One reason the tables like the one cited above for cost comparisons are limited is because of "bundling" and "unbundling". Ask one hospital how much they charge for an appendectomy and they may quote $3,000 and another may quote $10,000. But when two patients walk out of the two different hospitals after their appendectomies, the insurance company for the one at the $3,000 hospital may end up paying more. That's because that hospital may charge separately for charges: days of hospitalization, IV fluids, bandages, dietary support, hospital meds, etc. The second one may have "bundled" all of those into a "global" charge for an appendectomy. While the second one at first may sound higher, to an insurer it's a known and limited expense; they pay $10,000 whether the person stays in one day or has complications lasting weeks. The second hospital is incentivized to manage expenses for that appendectomy so they can keep as much of that $10,000 as profit (I'm GREATLY oversimplifying this - there are ways to be paid for those outliers - but the general concept is loosely correct. And the rest of this post is also simplified but loosely correct, for illustration).