Almost two years ago when I was just starting to learn "university mathematics" I asked this question related to how much memorization should one do when learning math.
At that point I was (as I also said there) mostly self-learnt because I hadn't attended formal lectures yet. Nevertheless, my university experience has definitely been unusual due to the pandemic. All my exams until last semester were online, so they obviously didn't have questions such as "state and prove Theorem X in the lecture notes" because they were open book exams.
But ever since returning to closed book exams questions such as the one I quoted above occur on many of the exams. Some professors give us a list of the results from the lectures that we need to know how to prove, others just say that any result in the lecture notes can come up in such a question. Mind you, some of these theorems are highly nontrivial ones (for instance, on my Abstract Algebra exam one of the possible theorems whose proof we might have been asked to reproduce was the Fundamental Theorem of Algebra and its "most algebraic" proof, i.e. the one using symmetric polynomials, the one we covered in the course, is kind of complicated and long), so most of the students fall back on memorization for such questions (to a greater or less degree; it's obvious that a good student won't just memorize how to prove simple statements simply because they can produce those proofs anytime they are requested to from the top of their head without much effort, but for difficult theorems even good students memorize the proofs to a greater or less degree - see below for further explanations).
I initially thought that this had something to do with the culture of my country (I live in Eastern Europe and here our school system often asks you to memorize stuff), but after a bit of Googling I found that even at top universities in the world such questions do come up on exams (I remember seeing an exam from Cambridge that asked the students to state and prove Cauchy's Theorem in Group Theory - I don't consider this to be a result that one can just prove from the top of their head) and I can't seem to understand the point of asking such questions. I for one try to do the proofs of the theorems in the course as many times as possible and I try to understand the steps. But, in the end, this results in more or less memorizing the proofs because of all the intermediary steps and the computations that I don't really have the time to work out on the spot during the exam due to time constraints. I can do those parts just fine provided I have the time, but in an exam I don't have that time and I end up committing to memory those parts of the proofs. This doesn't seem beneficial to my understanding of the subject and this is why I don't get why such questions seem to appear so frequently on closed book exams (most of my peers seem to be in the same boat as me, so that's why I don't get this questions).
P.S Let me know if this question is better fitted for https://matheducators.stackexchange.com/.