I had read some references to the banana thing before which described it as having been done as an actual experiment. I've not been able to find any documentation of the experiment itself, and it doesn't sound like one that somebody would actually do. Still works pretty well as a metaphorical description of human behavior. Many of our cultural taboos are simply matters of unquestioned tradition. That thing is bad because the other monkeys will punish you for it. The other monkeys will punish you for it because it is bad.
How god got started:
I'm inclined to think animism, ancestor worship and some form of theism slightly predate religion. The human tendency to see faces in the clouds, attribute personality and intention to aspects of our world, and speculate on our origin and purpose, is pretty self explanatory. We find ourselves existing in a world full of complex forces we don't naturally understand. Water falls from the sky with no explanation. The ground shakes or even occasionally spits fire for no clear reason. The Sun rises and sets according to some invisible clockwork. And here we are, seemingly alive and conscious with no real idea how we came to be that way. And we ask ourselves why.
Sure we've got cosmology and sh*t now, but try answering any of this ten thousand years ago without resorting to a creator.
It is that preexisting impulse that religion exploits.
How religion got started (another metaphorically true story about monkeys):
Back in the days when humans were basically monkeys and science, witchcraft, and priestcraft were not exactly the separate things they are today, some of the more enterprising monkeys noticed some patterns and figured out a way to exploit them to the great awe of the dumber monkeys. The ones who could read and count started to realize the cyclical nature of years and seasons. Then one day, the great high monkey shaman had an idea. The monkey shamans had already been making a decent living dispensing herbal remedies dressed up with a blessing and an arcane song and dance so the locals wouldn't realize they were paying to eat a weed that grew in their yard. But if he could pull this off they'd be set forever. They had observed that these dumb*ss monkeys would basically believe whatever bullsh*t they were told. But would they believe this? It was certainly an ambitious scam, even for the same simpleminded audience that had believed his earlier story about the world hatching from a coconut. Most had lived through a few winters and some would remember that winters ended on their own. No matter. The great high monkey shaman made a mental note to loudly dismiss the doubters as sinful and have them killed if possible, and he set about with his plan. He gathered the monkey chiefs and made his announcement.
The Sun was going away.
That was why the days got shorter. That was why the snows came. Those monkeys out there bitching about the cold winter are being punished for failing to please the monkey god. You have all failed to please the monkey god. But it isn't too late. The monkey god has not completely abandoned us. If all of you gather up all your bananas and bring them to the temple of the monkey god and sacrifice them on the day I tell you to, the Sun will come back. And it worked. The sacrifice was made, and the Sun acted predictably (predictably if you already know how the trick works).
A few weeks later the great high monkey shaman looked down from the steps of his temple, and watched the monkeys in the street still celebrating that their prayers had resulted in the already inevitable. "God damn" he muttered to himself as he went back inside to continue counting his bananas, "these f*cking people will believe anything".
And thus was religion born.
How religion stays in business:
The banana thing.