This is a philosophical question.
From undergrad (which I did stem), I have noticed that in some classes, the teachers taught the absolute bare minimum, almost like overviews of a topic, often times with no examples (as they are allocated to the tutorials), whereas the exam coverage often involves material that are usually much more advanced, with details far surpassing the lectures or even the textbooks.
This trend gets even more extreme in grad school. Sometimes the classes (say a math class) simply involves a lecturer jogging down a few key results, write a few equations on the board. Proofs, if ever even given, tend to be handwavy. Whereas in the assignments or exams, these equations and proofs for these results may need to be derived from scratch.
In other words, there are many things that students need to fill by his/her self. Much of the learning do not occur because of lecture but rather from preparation for exams.
So in a sense, "taking a class" is not to learn from the lectures or to gain some panoramic understanding of a subject, as much as to wrestle with the assignments and exams, which may be very narrow in scope.
Is this the correct way of thinking about the purpose of taking courses, i.e., just to pass the exam of these courses, however narrow they might be in the context of the entire subject that's taught?