Inbreeding and genetics are factors too, but IQ is most definitely affected by nutritional factors in utero and in early childhood, especially before age 2. No matter how well you feed them after that, the cognitive damage from malnutrition cannot be fully corrected. The brain is still doing critical growth and development at that age, and the developmental window then closes.
What you say is quite true, and it may apply in poor nations in the rural areas, where the malnutrition is very real.
But it can't have an impact on the wealthy nations. There are no poor Saudis or Omanis, for instance. No citizen of the UAE is less than middle class, too.
Yet they still test out at about 85... of course, they also marry their first cousins! Even mother's milk can't be that health when mom's your aunt.
d.o.l.
Criminal Number 18F