We seek an answer but there is no answer. We can never know how our universe came to be. We don't have someone to tell us and we can't go back in time. We think science might help us but science has limits that we can't overcome.
There's also the overwhelming fear of death. Religion gives us relief by teaching that there's an after world. No one has returned from death to tell us all about it so we have no absolute answer. So anything you believe has a chance of being right. I choose to believe that our spirit continues. It works for me.
The desire can become so great (especially during times of insecurity or trauma) that people will start imagining that such a being/beings/force exists, and has offered them agency and a path.
Such beliefs are actually evolutionarily useful because they can counter the despair that can creep in during stressful times, giving believers a survival edge. They can also foster social cohesion, another survival edge.
Mystics are people who have seen, in moments of satori, the importance and significance of certain truths which most people recognise as religious in nature.
Others, observing the happiness of transcendent bliss, and wanting such happiness for themselves, take note of what the mystic says about the truths hinted at above, and a religion is born.