So is science. And philosophy. And just about any human attempt at the endeavor of thought.
Religion began as just a way to explain why lightning occurred and people died. The concept of the afterlife is rooted in the basic human fear of death - non-existence is such a tough concept to grasp. Nowadays we know via the scientific method why lightning happens, though no one has ever come close to answering the second question. Religion may be an outdated method to explain natural phenomenon and has been successfully replaced by science, but as long as people fear death, there will always be a market for it.