For the vast majority of people their religion is merely a contingent by-product of their uprising, created by the mere chance of where they were born and what world views their parents have. If they scrutinize their religious ideas they will quickly find out that there is nothing at all to them, that they are illogical and untenable, not supported by anything besides what religious institutions tell them. In brief, religion is based on bullshit.
However, religious institutions and leaders of all confessions, from the shaman of a local tribe in Papua New Guinea to the Pope, have put and are still putting a lot of hard work in keeping people from scrutinizing their thoughts and world views, and it helps them that many people prefer to stay religious even though they are not really convinced, because they fear the wrath of supernatural beings. Only those very rare people who have been raised in a completely atheist and secular way are free of such fears (but of course that doesn't mean that they have no other fears).