Just like real life. When schools had more prestige, they also relied more heavily on intensive oral examinations. Some of the most prestigious schools in the world still rely heavily on intense oral examinations.
Universities can also crib from how law school exams work if they want to still do written examinations.
Every school (and many university professors) does "cold calls" in Italy, as far as I know; scheduled oral examinations are the exception, not the rule, before university. Not knowing the answer at a random university lecture doesn't generally impact your grades, however, because in most cases those are 100% based on a final (often oral) exam.
I wouldn't argue that it is a system without issues but it's still better than rote essay writing.
Universities can also crib from how law school exams work if they want to still do written examinations.