"qualify" is nebulous. When professors accept PhDs, they are looking for people who they want working in their specific labs. It is much more like applying to a job than applying to undergrad. I have pulled candidates from the pile who had sub-par test scores but excellent writing skills, for instance, because teaching good writing to adults is much harder for me than teaching computer science. Similarly, I've taken students who reached out to me with ideas for followup on my papers over students with great test scores who didn't seem to care what they worked on. Random sampling is a terrible strategy for PhD admissions.