Religion is needed as a path to return to God because our first ancestors separated from God. Initially there was no need for religion.
Once our liberation is achieved, religion will not be necessary. It will be the era after the coming of heaven.
there was always religion if it could be defined as belief in powers beyond human control