Scott Alexander in Astral Codex Ten:
Educational attainment is closely correlated with intelligence, but not perfectly correlated. How far you go in school depends not just on your IQ, but on other skills: how hard-working and motivated you are, how well you can cope with adversity – and arguably also less desirable qualities, like whether you so desperately seek societal approval that you’re willing to throw away your entire twenties on a PhD with no job prospects at the end of it. “Genes for educational attainment” will be a combination of genes for intelligence, and genes for this other stuff.
At some point, some geneticists just did the hard thing and found some actual genes for actual intelligence, separate from educational attainment. And if you have both the educational attainment genes and the intelligence genes, you can subtract the one from the other to find the non-intelligence-related genes that affect educational attainment in other ways.