In my experience as a student, it's mostly humanities (such as history) that are about remembering and mostly STEM subjects (such as mathematics) that are about understanding.
In a mathematics or programming test, they can even let you use the book and you still won't be able to do it if your level of understanding is insufficient.
But you would be able to pass a history test you're not well prepared for if you were allowed to use the book.
But, then, it also depends on the teacher. There are good and bad teachers.