In most wealthy countries, kids are a liability because you have to feed, clothe, and shelter them without them delivering any kind of return on investment. In poor countries they tend to be an asset because they end up being extra farm hands, laborers, etc.
The value of child labor is quite modest, they work at slave labor rates. The primary reason to have kids is to have them support you economically and otherwise when you're elderly and they are young adults because being old and childless is harsh in many poorly developed societies. High risk of child death leads to "insurance", 95% of the women have an extra child because 5% of them will die. Losing a child is of course always a tragedy, but in the western world you'll still get to live at a decent nursing home and have most your needs taken care of so you don't need a fallback plan.
From what I understand, the population boom in Africa is not really necessary anymore. But it takes quite some time from you stop needing it until people realize it. Not to mention a lot of cultural momentum, if it's normal to have five kids many women will have five kids. And as you get wealth the pyramid starts turning, instead of having five kids to support you maybe it's you who want to divide your wealth on two kids and not six poor kids. It's a lot of psychology involved, not just economics.