It depends on the teacher/professor and the class they're teaching.
I've had teachers give open book exams as mercy for weaker students, to build confidence, and to develop the skill of going back to check the textbook.
And I've had a professor give an open book exam because it was the only way to complete their exam.
Luckily, I've only heard stories of professors that give open book exams because they knew you couldn't read all the material. đŸ˜¨