How and why are PhD programs free in Europe? In some European countries, PhD programs are free. As I understand, PhD opening depends on the research funds of the supervisor. In other words, PhD research is funded by a national agency or EU.

Some countries offer the programs for free and an international student in the UK should pay about $20,000 per annum?

In addition to the research cost (which is funded through the same routes), a PhD student has other expenses for the university, which is provided by the tuition fee in the UK, while in countries with free PhD programs, the governments provides the supports (correct me if I am wrong).

My question is: Why/how such governments support PhD education of international students? And if it is reasonable, why isn't it the case in the UK?
I believe what you're talking about is the issue of tuition waivers: that is, are students obligated to pay fees for the tuition, or are those handled by the university.

In many countries in central Europe (including Scandinavia, Benelux, Germany, Switzerland, and Austria) PhD studies are actually paid employee positions, so what tuition charges exist are small, since students normally don't have to take many courses as part of the PhD program (international students may need to register for a few classes to satisfy qualification requirements, but it's not a coursework requirement per se). In other locales, such as as some programs in the US, grants cover tuition charges as well as stipends, preventing students from having to pay those charges. And in many of those countries, the tuition fees amount only to a few hundred euros, not tens of thousands.

It's only where students are expected to do large amounts of coursework and where no arrangements to remit or waive tuition are made that students are responsible for paying large amounts of tuition.