In my opinion, humans believe anything based on the following things:
1.) Whether or not it supports or contradicts things that they know to be true.
2.) Whether or not the people around them believe it.
3.) Whether or not they benefit from believing it.
#1 Is obvious and needs little explanation, it's the reasoning behind science among hundreds of decisions made by people every day.
#2 Is seemingly due to the need in society to make decisions whether or not to believe and therefore support or adhere to something that you know little or nothing about. This behaviour can clearly be seen day to day, from which political parties to support, to whether or not it is safe to keep a mobile phone next to your testicals. This is a beneficial adaption in humans that has become necessary for our survival, it is impossible to make all our decisions based on whether or not they conflict with what we know to be true as it would take many life times of study to know all the necessary factors.
It is important not to excuse yourself from #2 if you feel that you do know everything there is to know about a subject, it's irrelevant as it is instinctual. #1 may overpower the influences from #2 but those influences will always be there regardless.
#3 Is a more subtle and hard to pinpoint contribution. Again instinctual, a lot of it is based solely on the direct benefits that the belief promises or suggests, but it partly varies from person to person based on the quantity of time and effort they have gone to towards defending their belief. We all know that people like to be right, it's in our nature to prove to society that we are the best. This plays a large part in sexual selection and therefore will subconsciously if not consciously play a large part in the typical behaviour of the opposite sex.
The fear of challenging or questioning the principles that the belief dictates also plays a large role here. In the case of some religions this could be due to the apparent ever watching and all knowing presence of god, and the necessity of a clean and faithful mind, to avoid eternal punishment in hell.
I would expect that the strength of every person's beliefs in anything, religious, scientific, political or mundane would consist of different ratios of #1, #2, and #3. But it doesn't explain how religion came about in the first place.
To understand that we need to look at another trait of human behaviour; to analyze our environment, question, hypothesise and speculate as to the reasons why things occur because that is key towards making tools and surviving in such a dangerous environment with nothing other than a brain more adept than our competitors along with dextrous hands and speech.
This is why from the dawn of human evolution, we have tried to answer questions such as "if I created this tool, who created me?" with stories of gods and religions. Because it is beneficial to hypothesise.
Those in power would then realise that they could control and manipulate the masses well if they harnessed the instinct to believe in a creator and imposed further conformities on this belief and enforced it further through implementation in every possible way of #2 and #3 on every newborn child to enter that society.
I believe religion to be a political tool (often exercised in the form of war) based on exploiting human instinct and it has evolved in many different societies separately from scratch. It would be a safe bet, if we put 500 self sufficient newborn babies on a desert island somewhere, they would eventually come up with a new religion of their own and given the time, and political influence they would believe it just as adamantly as religious extremists do today.
I want to encourage discussion on this post and I accept that there are several missing elements to #1 #2  and it would be a great insight into religious tendencies if we could understand these better.