There is a handful of developed countries where this is not an issue.
Different countries are handling this in different ways, with encouraging immigration being the major one. Japan is facing a major lack of workers, with many businesses having to shut down as a result, but have decided to tackle it in a different way relying on advanced robotics as an alternative to immigration.
There are very few developed countries NOT having this problem. Most of the population growth is in poorer parts of the world like Africa.
Going purely by the evolution theory and natural selection, having so few children that there is a serious risk a population will disappear in a century or two, means losing. Needless to say, this is stupid. From the entire American continent, to Europe, India more recently, Thailand, China, the Koreas, Japan.
Africans, Arabs, and some non-Arab Muslim populations will carry the torch. Much respect for not falling into the trap.
I'm not saying fast fall in birth rates isn't a problem, it obviously is. However, nearly all countries that don't have this problem offer much worse quality of life than those which do.
I don't know the exact correlation but even in Morocco, total fertility rate is declining very rapidly, down from 6 children in 1980s to now around 1.7 in urban areas. UAE (Dubai) has similar TFR to Belgium or Portugal.
Honestly you're reading the data completely wrong. You cannot look at it at the country level. In Israel for example the populations that are producing the most population are highly religious and less educated than those that are producing less population.
It's more about memes. Religion is a meme driven breeding cult. This is why said religions tend to have very long term staying power. The particular problem here is these religions come at a cost of having to ignore a lot of reality to get to that point. Because they are faith based anything that presents a direct challenge to that faith must be setup as an enemy or it may risk the religion. Yes, religions can incorporate new information but it tends to be a slow process as it needs to involve slowly changing peoples mind to avoid instability.
What this looks like in the long term is large populations of highly religious that have a fundamental disconnect from the technology that's keeping them alive. A new Late Bronze Age collapse.
And if that fails, we've got "Idiocracy" to save the human species as the dumb-asses pump out babies as fast as you like.