One can make a habit of anything. If one is taught from a young age to pray, he will pray out of habit. Prayer is not done for the well-being of the god one prays to. It is done for the well-being of the one who prays. It is also done out of fear. The fear that if one does not pray, something will be taken away from him, or that he will be punished. Man has turned god into a genie and a warden.

