We know it is genetics that is the most important (though admittedly not the only issue).
How do we know this?
Africa has the lowest IQ in the world.
When Africans are brought to countries with much higher IQs and better educational systems the IQ does go up a fair amount—but is still well below the world average.
A poor peasant in Laos with no formal education will have an IQ at least twenty points above a poor peasant in Africa.
“Africa has the lowest IQ in the world.”
Africans on average get the worst K-12 education in the world. Of course they will, on average, score lower on IQ tests.