It's the same in all affluent countries where women are empowered and in control of their fertility, Japan is rapidly aging and China is having trouble kick starting population growth after ending the one child policy. In poor countries children are still old age security, like they used to be in the affluent countries and before women gained control of their fertility. The pill was probably one of the most important technologies of the 20th century and impacted the most people.
The reason for population decrease in affluent countries is women's empowerment and that was greatly increased with contraception. If you think your kids will survive until adulthood, have social security and the means of contraception, then you will have fewer of them. In Muslim countries where women have little power there is not much of a decrease in population growth.