They'll lose a bunch of members as the underlying need goes away. Different people get different things from the same religion, and need it to different degrees, so the people who still need whatever is left over will still cling to it. The religion will fragment, as different parts of what's left over are meaningful to different people. These fragmented versions will recontextualize the core beliefs and texts to whatever the different flocks of believers need. During this entire process, the religion (and its offshoots) will hemorrhage members, while the remaining ones appear to become more and more devout in their belief, because the wishy-washy ones leave more easily than the diehards.
They'll lose a bunch of members as the underlying need goes away. Different people get different things from the same religion, and need it to different degrees, so the people who still need whatever is left over will still cling to it. The religion will fragment, as different parts of what's left over are meaningful to different people. These fragmented versions will recontextualize the core beliefs and texts to whatever the different flocks of believers need. During this entire process, the religion (and its offshoots) will hemorrhage members, while the remaining ones appear to become more and more devout in their belief, because the wishy-washy ones leave more easily than the diehards.