Most religions spread virally, which means the marketers are the customers, which is usually a testament to the product/service being one that customers value. I say this as an atheist who's not a fan of religion, but people clearly get a lot out of it, or at least believe they do.
Probably neither. People like to belong to a group where they feel they "belong" and that in itself is sufficient explanation for the spread of religions IMO.
Propagation of societal values and/or fear of hell and/or fear of death assuaged by the assurance of an afterlife and/or being able to rationalize away the vagaries of nature as the will of god(s) are just optimizations after the core system was already invented.
There is a place for religion. Something that pushes you to be better than you are. Along with the happiness and fulfillment that comes from that effort. Selflessness, love, compassion, truth.
Plenty of bad religions telling you that you are perfect the way that you are. Just give me money, fame, or influence and I will flatter you and pump your ego.
Another form of this is flattery in exchange for hating something. Many doomsday cults fit this category. All your life problems are because of 'insert target X'. But I, I have the answers you need.
Religion is more attuned with purpose, where your heart is, than the belief in God. Though the two are often paired.
There are plenty of things that deliver the above without the dogmatic slaughter of hundreds of millions of humans throughout history and at this very moment.
There's also plenty of religious people who have never murdered anyone in their lives, and there have been plenty of dogmatic massacres for reasons entirely unrelated to religion. The two issues seem to be quite uncorrelated tbh.
Religion requires belief without evidence. (Or flimsy evidence like ancient testimony.) It's uniquely positioned as a tool to manipulate people to do things they wouldn't otherwise do.