Religion has always been used to explain that which we cannot account for by scienctific knowledge. In fact, that might be a good definition of religion.
That's what's been called "The god of the gaps"--and I tend to think it does happen just that way. But of course the inevitable result is that, as science gradually fills the gaps, the space available for a god to fill is less, and (in principle at least) you could get to the point where there's no gaps to fill.
Of course many of us, seeing that tendency, feel it reasonable to jump ahead and adopt that end state.