I grew up believing it was 100% cultural.
My best guess now is that those who study such things are probably right, and though a good chunk of it is cultural a perhaps larger chunk is due to different genetic averages.
That doesn’t mean that much shouldn’t still be done on the cultural side, it only means that expecting totally equal results among different populations may not be realistic.
Charles Murray says much the same thing. You’re on solid ground.
I had a friend in Naval Nuclear Power School who flunked out. At one point his counselor sat him down and said something I'll never forget.
"Look son, you can be lazy and graduate from NNPS. You can be stupid and graduate from NNPS. But you can't be lazy and stupid."
You don't have to be a genius to get a math or engineering degree. People with very average intelligence can do just fine in STEM studies. People who've been given no work ethic, critical thinking skills, study skills and have no goals won't do well in any field. I blame culture.