The at fault driver (in a state that is not a "no fault" state) has a legal obligation to pay all of your medical bills and all other economic and non-economic harm to you caused by the accident in which the other driver is at fault (without regard to whether you paid it out of your own pocket, or your insurance company or other third party did). This right is usually enforced by a lawsuit against the at fault driver or a threat to sue the at fault driver.
The at fault driver's insurance company has agreed to pay up to its contractual obligations to cover this obligation, and the at fault driver is personally responsible for the entire amount, whether or not it is covered by their insurance.
Usually, health insurance will pay whatever its contract provides what it covers, but the health insurance company will gain a right called a "providers lien" to recover from you the insurer's share whatever you recover from the person at fault (whether or not insured), in its own lawsuit if it wishes, and a "subrogation right" to sue the person at fault for the amounts it had to pay out (with which you are legally obligated to cooperate) if you do not.
Often, if the at fault driver has no insurance, or has inadequate insurance, your car insurance company will pay what the at fault driver should have paid if you have uninsured/underinsured motorist insurance on your own policy, and if so, the medical providers and/or insurance company will have a lien on the amount owed to you by your own car insurance UIM policy before you get any of it.
In Massachusetts, in the USA, this is complicated somewhat by "no fault" insurance.
In a nutshell, this means that in MA, in minor accidents, you can't sue the other driver and your own car insurance policy, rather than the at fault driver's car insurance, pays for your medical bills and injuries (in much the same way that health insurance and casualty insurance on your home do when harm is often not a third-party's fault). The threshold for serious in MA in most cases is an injury that needed $2,000 of medical bills to treat (some serious injuries and deaths that don't require expensive medical treatment are also singled out).
In a serious accident in MA, your own insurance pays for the first few thousand dollars of medical bills, and the remainder is handled as described above.
The reason for "no fault" insurance is that as a matter of policy, the state has decided basically that figuring out who is the at fault driver in minor accidents costs more than it is worth, given the small amount of money at stake and the high costs of legal proceedings to figure it out.
The exact rules governing priorities between health insurance (or other health benefits or programs), no fault insurance, worker's compensation insurance (which applies if you are on the job at the time of the accident), UIM insurance, and third-party liability from the at fault parties (possibly more than one at fault driver and possibly a company that made a defective vehicle), is sometimes rather complicated and beyond the scope of this post beyond the general outline presented above.