It is racist to imply that certain people have higher IQs than certain other people.
Genetics is partially involved. This is why smarter parents have, on average, smarter children.
Environment is also a factor. Fetal alcohol exposure, malnutrition, micro-nutrient deficits and lack of care all stunt growth - regardless of your genetics. The disease load of malaria and worms could account for some of the decreased IQ in Africa, relative to the rest of the world. Or why the lower classes are always deemed dumber - poorer diet and higher disease burden made them so, not necessarily bad genetics.
“Guns, Germs and Steel” says natural selection / social selection is responsible for Ashkenazim Jews having an average intelligence one standard deviation above average. However, another text mentioned that Jews were more likely to have books in their homes and be literate relative to Russian neighbors of the same social status - a cultural trait.
In short, genetics determine your maximum potential. Environment can cut it short. The current black culture tearing down kids who try to excel in academics, a lack of two-parent families for support and involvement, a heavy dose of drugs and crime and stress create a toxic environment.
Whether the black “average” is lower than whites is debatable. What is fact is that their current culture creates an environment that lowers their collective IQ.