1. Better nutrition for everyone. There were words for people left retarded due to a lack of iodine - which no longer happens. Retardation due to a lack of protein is now rare, though you still see vision loss due to lack of vitamin A in parts of the developing world.
2. Lower disease burden. Vaccination has essentially wiped out scarlet fever and rubella, diseases that left many children blind, deaf or retarded after it fried their brains.
3. Smaller families, more investment in most children. As family sizes decrease, each child gets more food and higher quality food - so malnutrition doesn’t erode the brain development of children other than the oldest boy and child hunger is less likely to interfere with schooling.
4. More schooling for everyone. More kids worldwide in school instead of being pulled from school to earn a living. School rates are rising, though progress for girls’ education in Asia and Africa still needs to be made. Exposure to more ideas and people away from the immediate family helps improve the abstract reasoning of children. A girl who has never left her home will do poorly on IQ tests, relative to a child who has been with teachers and classmates from age 6 or 7.
All these, as you are no doubt aware, pull up the low end of the scale. They allow those who in previous centuries would not have been able to get close to their genetic potential, to actually do so.
I don’t buy “better nutrition for everyone.” I don’t believe that the children of upper or middle class people ever suffered from nutritionally imposed failure to develop mentally.
Poor people, sure. And since through almost all human history most people have been poor, slight improvements in diet for them made huge differences in average IQ.