For most university classes I have come across, the professor teaching the class is also responsible for making (and usually grading) the exam, or holding an oral exam. As far as I can tell this is true in most (at least Western) countries.
There are a few exceptions, e.g. some (but certainly not all) universities do not allow the supervisor to be part of the examining committee during a PhD-defense, and many high school educations have a centralised exam at some point.
Does combining "teaching" and "evaluating" in a single person not create a conflict of interest - and why is this so prevalent at universities?
As people were wondering which conflicts of interest I was referring to: all of them :)
I was mainly thinking about the fact that teachers are usually evaluated based on their performance, which is either measured through e.g. student pass rates and/or student evaluations. Both of these provide an incentive for the teacher to make the exam easy to pass, either by making an easy exam or by preparing students on very specific questions in a hard exam.
But there are also arguments to be made that this system is not particularly good for the student-teacher relationship - I personally find it a lot easier to teach and motivate students when I am not evaluating them, because it has more of a "I am helping you to pass the exam", and less of an "learn this or I will fail you" atmosphere.
In my understanding, the conflict of interest actually goes in the other direction: if the teacher is not the examiner, then the teacher has a conflict of interest because their job depends on the performance of the students on the exam.
In the United States, tying lower levels of education to test scores has created quite a bit of "teaching to the test," as well as other ethically problematic practices like schools cherrypicking good students and attempting to expel special-needs students because the funding of schools and the careers of individual teachers are both closely tied to how their students perform with external examiners.
As such, I think that it is a very good thing that at the university level and postgraduate level, most education is allowed to be much more customized. Note, however, that in professions where there are strong ethical and safety issues involved, such as law and medicine, there are still external testers but these tests are more holistic certifications rather than individual class evaluations.