They look at every personality trait that is correlated with educational attainment, and check which ones are also correlated with gender. The most interesting paper I’ve found exploring the reasons for the gap is Spinath et al. There’s also some evidence that girls have a small advantage in verbal intelligence and that boys have a small advantage in numerical ability, but the mean IQ of boys and girls does seem to be about equal, so it seems unlikely that this explains why girls do better at school. That isn’t to say that there aren’t any differences between how boys and girls do on IQ tests - a few studies have found that boys show greater variability in IQ (they’re overrepresented among people with very high intelligence and with very low intelligence). I think we have pretty good evidence that this isn’t the case - girls don’t score better in IQ tests than boys. The most obvious suggestion is that girls are just smarter than boys. Either way, it’s pretty clear that girls do better than boys at most subjects, even if the difference in maths is debatable. It’s true that there are some studies that suggest that boys do better in maths, but they seem to be outnumbered by those giving girls a small advantage.
Noteworthy findings were that the female advantage was largest for language courses (mean d = 0.374, 95% CI ) and smallest for math courses (mean d = 0.069, 95% CI ).” “A small but significant female advantage (mean d = 0.225, 95% CI ) was demonstrated for the overall sample of effect sizes. That’s the finding from Voyer and Voyer’s meta-analysis, in which they note that: Even in subjects where boys are often thought of as performing better than girls (like maths), I think the evidence generally suggests that girls actually outperform boys at school, but the effect size is smaller than for other subjects. This hasn’t always been the case - girls’ grades have been getting a lot better over time. There’s a ton of evidence for this - see here, here, or here. In most developed countries, girls do better than boys at school.