A recent article at the Huffington Post by a neurophysiologist predicted that religion would disappear by around 2040 because of the progress of modern technology. He said that his conclusion was based on the hypothesis that religion was coping strategy to deal with existential threats to existence. Since modern science has successfully removed many such threats and seems likely to remove many more relatively soon, there seems no such remaining motivation to be religious and religion will soon cease. Such a hypothesis is a version of secularization theory - a theory that claims religion declines as material progress advances. Decades ago such theories seemed questionable because of contemporary counter examples like the USA being most modern but still most religious of western nations and the resurgence of faith in former Communist countries. But continuing developments have resuscitated such theories, such as the flight of millennials from churches and the progress of same sex marriage. Even Peter Berger has changed his mind back to re-affirming secularization.
Examining the existential threat theory, it clearly has plausibility. If we think of secularization in terms of William James account of "genuine belief options" from his essay "The Will to Believe", it seems that modernity has made religious faith no longer a forced belief option. If one has to choose between faith in a promise of heaven over a reasonably long and comfortable life provided by modern technology you may think it reasonable to suspend judgment until you get terminal cancer that they don't have a cure on the horizon for yet. Another thing that modernity may do is no longer make faith a live option due to prima facie incredibility.
But neither of these really holds up as James might have understood it. For the second, the limits of science are just as apparent as its accomplishments. At these limits, the scientist turns to philosophy, often without owning up to it, such as how to reconcile realism about science with the incompatibility of General Relativity and Quantum Mechanics, what existed before the universe existed, what is the relation between physics and Consciousness, etc. These seem not only unanswered but in principle unanswerable by science. Yet there must be facts a out such things that make philosophy the most rational approach available.
As to the first, no intelligent person qua being intelligent for its own sake would or has been content with modernity's successes (Dostoevsky, Kierkegaard, Kant). Suppose one day science finally gives us a machine like the Matrix which holds out the promise of downloading the experience of a long pleasurable prosperous seeming life made to our specifications to whoever wants to be inserted into it. What would you think of one who would volunteer? You still wouldn't necessarily think their lives worthwhile or that they really had it made. You could still wonder if death is really the end or if there will be or should be an ultimate accounting. From the rational point of view, the choice to believe in some future existing Matrix or believe in another life in another perhaps more real world is still a forced option. What makes the option forced is the demand on the self that goes with rigorous commitment. Even without the dread of existential threat there still is the longing for existential meaning and justice and love, the pursuit of which makes the option still forced.
So genuine belief options do not explain the secularizing influence of modernity by existential dread. The actual explanation has more to do with man's animal nature than his rational nature. Paul Vitz writes in "Faith of the Fatherless" about Freudian accounts of secularization. According to the doctrine of the Oedipal complex and repressed sexuality, the boy child goes through a phase of sexual attraction toward the mother while perceiving his father as a rival to be killed but his father's superior strength forces him to be resolved to the situation. But the complex is never resolved. When the boy is big enough to be a credible threat to his father, the Oedipal urges return.
It is possible to combine the Oedipal theory with Freud's projection theory to form a secularization hypothesis, where God is the cosmic father that imposes his sexual restraints on humanity by morally norming the orders of creation. While life is threatening the threat of God's judgment is compelling. But when life is brought under human control that sense if divine threat seems more and more remote. As science progresses, fear of God diminishes.
Such an effect can and has been created without science. As the Apostle Paul makes clear, mankind had lost its fear of God before by forming the belief in idol magic, that they could manipulate the lesser deities through ritual and sacrifice that had more direct control over the forces of nature, thus giving them something like access to the control knobs of the universe. As a result, God gave them up to indulge the lusts if their flesh and experience the natural consequences of their behavior.
The presence of existential dread has greater impact on the animal for which reason is only of instrumental value for the survival instinct. Such reason makes the dread "existential" but not really intellectual, where as the search for meaning is truly an intellectual passion. Secularization may be evidence that humans are more animal than spiritual.
However, Vitz gives evidence that inadequate fathering vs adequate fathering is a strong predictor of atheism and theism respectively (for the most part). His evidence includes notable and articulate theists all through the early modern and contemporary period, showing that material prosperity need not quench faith. Compare this with Mary Eberstadt's new research showing the role dysfunctional families have played in facilitating secularization and visa versa. An effective family is also a shelter from existential dread but not one that inclines to unbelief but rather to faith.
Family love and Fatherly bonding encourage humans to rise above instinct and lust to make choices based on either sufficient evidence or by recognizing genuine belief options where evidence fails to decide a question, to live as rational and transcendental beings. As for the future of religion, one could say with certainty that the natural law expectation all other things being equal religion will disappear by 2040. But this just begs the question of the truth of religion. If God exists, he may preserve a people to Himself for all eternity.