Religions don't necessarily work because people believe in it, either. There are a number of religious sects that started with end of the world prophecies.
I think that religions work the opposite way: people believe in them because they work. Since the purpose of religion is generally to explain the nature of reality and how to flourish in it, it needs to work for you. If it doesn't, you either just go through the motions, or quit and find a different religion (or swear off religion, which is sort of the same thing).