For kindergarten, my son was in an (expensive) private school with only 10 kids per class. The teacher was completely clueless and not a good teacher. We later learned that she was not even a credentialed teacher.
At our well-regarded public school, for second grade, he had 25 kids. It's going up to 31 kids for K-3 and 35 kids for 4-6th grade. It's hard to know if that will matter- I think there can be too many kids in a class. On the other hand, at 25 kids, the teacher for second grade, who was young and super smart, she had a handle on what each child was working on, their strengths and weakness, etc.
It matters alot on the teacher.