Through public schooling, due to test results and stuff, I was placed in gifted classes that fortunately kept maximum class sizes at only 15. There was a lot of freedom in them, with difficult subject matter, and there were not any behavioral problems with any boys or girls, nor any noticeable performance differences between boys and girls.
But not all classes had that option, so for some classes I was in other sections where there were 30 or so students in a class. My general observations were that boys were more aggressive on average, had more prevalent use of drugs, and many of them had a sort of macho culture where doing well in school was seen as uncool, which was not a culture that many girls had. There were more fights between boys, although occasionally fights between girls occurred, or in rare cases, a girl vs a boy. In younger grades there was less or none of some of those things, but boys tended to have more energy, it seemed.
School performance seemed to often be related to socioeconomic status. The students that did terrible, typically had rather difficult home lives due to poverty, abuse, neglect, or just a general lack of discipline for schooling. There were of course exceptions.
So my experience was that the school basically met the student where the student was at. If a student entered with willingness to learn, she could go into honors or gifted classes with smaller class sizes. If a student wasn't interested in school, or ran into trouble, they would generally find themselves in large classes with other students like themselves, in a negative feedback loop.
It seems to me that parents had a larger impact on a student's performance than the school itself. Out of students I knew, well-performing students tended to have organized home lives and educated parents, while poor-performing students tended to have difficult home lives, with parents that were less focused on the idea of their children doing well in school. Not every time though, innate differences in intelligence and other variables could result in a mismatch with a student that does well despite parents that are not interested, or the other way around.
So from my observation, I tend to view school performance as more of a parent thing than a school thing. I jumped around a few schools during kindergarten and first grade, until settling into one school system. Students that brought with them the mindset that they're going to do well in school, could work pretty well in any class setting. Other students were not caring of doing well, typically. Figuring out how to assist those students is important, but for me that's a tricky concept to figure out, and I haven't really studied education techniques.