Children are expensive and time-consuming, because in our society we're expected to take care of them, and the standard for that is very high. In developing countries, the standard is much lower and children are able to help run the household, so they're incentivized to have more children. As the things that make a country 'developed' spread in developing countries, the equation starts to tip the other way...