"As societies modernize, they become less religious." This is the "secularization thesis." Its roots go back to the Enlightenment of the eighteenth century. It was developed by the first sociologists in the nineteenth century. It has been hotly debated by sociologists, historians, theologians, philosophers, and other scholars for several decades. It probably passed its peak about fifteen years ago, but it still has its champions.
The discussions can be complicated. But let me reduce the thesis to three forms.
The retreat of Christendom