Obviously having generations of people put into bad schools and not be provided opportunities to have "good jobs" will lead to you not being able to take an IQ test well. IQ tests basically just examine how much analytical reasoning you learned in K-12. Like, any gray haired black person in America will remember having actual Jim Crow laws persecute them and it was literally legal to discriminate people for housing in America until 1977. It will take a massive amount of time to heal those social wounds that were inflicted on our fellow humans.
Actually IQ is highly genetic, and the amount it’s inherited actually goes up as one ages (meaning that while education and upbringing can influence IQ temporarily, genetics eventually dominates).
Top 10 Replicated Findings From Behavioral Genetics
This trend should persist as long as the quality of education remains unevenly distributed. You should also find very little to no heritability before or at the start of formal education (say age 10 and younger), and then heritability should increase as the discrepancies in the quality of education between families materialize.
To summarize this effect (called Wilson Effect) says nothing about how “genetic” IQ is, only that it correlates with the quality of education and that quality of education is not evenly distributed between families.
PS. As a manifestation on how insignificant this effect is in the scientific literature, Wilson Effect doesn’t even have a Wikipedia article, referring you to [the Heritability of IQ](https://en.wikipedia.org/wiki/Heritability_of_IQ) which references a paper about this effect only once in the beginning summary.
The researchers aren’t stupid, obviously they try to control for things like schooling.
Therefore, the strongest evidence for heritability of IQ (and the fact that it increases with age) comes from twin studies, where twins were separated at birth (by adoption).