As someone who helps medical students find research mentors, there are a lot of factors here. One of the most important factors is whether the school pays the students for their research time or whether any payment comes out of the individual labs. At schools where the PI does not have to pay each student themselves, there are more PI's who are interested and able to take on students.
Also, of course it is supply and demand. Even a large class size of students can be accommodated if the school has a large research faculty - you can estimate this by looking at the USNWR rankings for research. While not perfect, a school with a large class size and low research school ranking will probably have issues with there being enough opportunities for everyone.
And lastly, it will somewhat depend on an individual school and in what sub-specialty the individual student has an interest. Even at our research heavy institution, there are times when the top researchers in a smaller field who work well with students (in ENT, or DERM, or ORTHO, for example) have no more room for another student, especially if there are a lot of other students currently interested in the same field and/or the student emails the PI in Spring for a Summer project.