Public health insurences (there are over 100, but they are all organized in an umbrella organization) give out licences to doctors to be allowed to practice on publicly insured patients. The doctors get some amount of money they can spent on patient-specific prescriptions, but in general the doctors only prescribe the active ingredient. When the patient goes to the pharmacy to get their prescription, the pharmacy looks up the insurence and hands the patient the medicine that the insurence dictates. A doctor can prescribe a specific medicine but has to pay for it themselves (mostly from the money the insurences previously provided, see above).
Insurences check about 10% of all hospital bills and just don't pay what they deem unnecessary. Hospitals are therefore careful not to do things the insurences didn't approve of. There is an open catalog of therapies that the public insurences will definitely pay and how much it may cost, so it's not a secret.
They will also push for modern treatments if they reduce recovery time and have less risks.
There is a lot more to the system but that's the gist.