Masters programs are typically where you pay tuition and receive training via classes. PhD programs don't have much classwork and instead are positions where students are paid by the university but are expected to perform labor to produce original research.
Hm, here in Hungary PhD students can opt to do zero teaching[0], and also the tuition is 4500 EUR/semester (and students from the EU can apply for grants that covers 100% of tuition). And on top of all this it's possible to work for the university, which apart from the salary also results in the elimination of certain costs (eg. if someone is not employed by the university they have to pay to have their thesis examined and pay for the exam committee or something).