In the beginning were simple creatures with no neurons. Then there were those with few neurons and limited brain power. Thus, they were restricted to few repertoires, which were hard-wired. They could perform single and simple functions corresponding to their primitive circuitry. These were mainly reflexes and instinctual behaviors with minor scope for modification as Kandel showed in Aplysia.
Let us take the example of a single fly in a closed room, being chased by an irate human, hundred thousand or more its weight and size. On top of this, the person is armed with a lethal weapon, viz., a fly-swatter. The fly senses the change in intensity and direction of the air pressure caused by the swing of the swatter and the alteration in the amount of light in its many compound eyes and is pre-programmed to fly away in an appropriate direction to evade the fatal descent of the swinging contraption. The insecticidal maniac with premeditated malice persists and the scene is replayed, until the hapless, ignorant fly is squashed to death. If the fly had an amygdaloidal nucleus, hippocampus and sundry nuclei of temporal lobes, it would realize after two or three murderous attempts, that relentless pursuit by a determined ogre, spelled fatal disaster. If it was evolved enough to have a prefrontal cortex, it would reflect upon the hopeless outcome and have a foretaste of its oncoming mortality. It would be sad and depressed and may even entertain the futility of its effort and life itself. If a fortuitous and fortunate gust of wind succeeded in opening a window in a timely manner during its escape flight path, it would exit the room with a sigh of relief. Now if it also had a Broca's area in its brain, to permit speech, it would share the gory details of this gruesome experience with sundry flies at a nearby rotting dump. The congress of flies would vow to be extremely wary in their contact with human behemoths and some of the flies would attribute an omniscient, omnipresent and omnipotent status to this fearsome human pests and conceive of the idea of praying to this human god with power over flies' life and death. Time and evolution may bestow on chosen flies the skill to use limbs, to mold pliable material into the image of a creature and a talented fly would make the image of a fly with a human face or a human with a fly's face or just a human. Some devout fly would start offering choice morsels of putrid matter, as a sacramental offering to the chimeric or human image, as a potential bribe or protection payment to appease the god or curry favor.
The wrath of humans is but one cause of the demise of flies and not necessarily the prime one. With further development of the frontal cortex, the flies would see that there was no justice in life, and they would be outraged at this unfairness, while being completely oblivious of laying their own eggs in the living tissues of other animals and thus permitting their young maggots to feast on living alien flesh. Thus the flies would invent an afterlife with a final judgment day and a god to give divine justice. A metaphysical philosophy would develop where good flies would go to eternal heaven and bad flies to eternal hell or flies would be reborn serially in consonance with their previous Karma and would eventually attain salvation, moksha or nirvana by merging with the Supreme fly soul in the sky or by escaping the recurrent cycle of old age, pain, disease and death. Some reflective flies would introspectively analyze their own unethical behavior and thus alter their concept of a merely just but harsh and tyrannical god to a merciful god willing to atone for the sins of others. Transient remorse and private or public confessions of their own unethical behavior would result; without persistent or successful attempt to eliminate evanescently acknowledged faults. Recidivism would continue unabated.
Further evolution of the frontal cortex would make the concept of god abstract and indescribable, with condescending disdain towards the polytheists, animists, chimera and idol worshippers. The final burst of additional neuronal development and time would allow the flies to understand and know physics, chemistry, biology, evolution. genetics, embryology etc. and the flies would never see the dead returning or being resurrected and become cognizant of the lack of justice, mercy in the endeavors and passage of life of all creatures. Mounting skepticism and knowledge would result in the dawn of realization, that there is no god and life is ruled by chance and necessity, nature is indifferent and the purpose of this newly evolved fly life is what each individual fly makes of it. There is no God or purpose and the corrosive super acid of Darwin's evolution cannot be put in any container. Nature, red in tooth and claw, devoid of mercy or goal, is the stage manager and on this set, the selfish genes are the actors, relaying a tale of futility. Thus the key ingredients, amygdale, hippocampus (temporal lobe) and the prefrontal cortex (frontal lobe), the seats of fear, memory, reflection, purposefulness; when allowed to simmer over geological time in the cauldron of ego, brewed the poison of God, religion and afterlife, which knowledge and analysis has deservedly consigned to the dustbin of extinction.
Prophets like politicians are fraudulent crooks, with large egos, a capability of deluding themselves about their imagined virtues and desperate for followers. They usually base their pseudo-new religion on some prevailing myths and dogmas, as too sharp a break would alienate potential converts. They synthesize compromise beliefs sufficiently different to deserve a separate status from prevalent dogma, but similar enough to ease the transition of potential converts from the faith in the catchment area. They also tend to pitch their religious jargon towards the have-nots who are always in the majority.
In ancient India, the Vedic religion co-opted the god Pashupati, phallic and bull worship as Shiva, Lingam and Nandi. This together with the inclusion of mother goddesses, elephant and monkey headed deities and unrestrained libido led to the unification of the subcontinent into the culture of primitive Hinduism. Reformation of this into the monotheistic, metaphysical and philosophical religion of the Upanishads still included the belief in rebirth and Jainism and Buddhism, both had to include Karma and Metempsychosis to obtain converts by not breaking totally from the older beliefs. Jainism, the first rebel with its austere penances, redemption through suffering and fanatically obsessive emphasis on non-violence was one extreme and Buddhism formed a syncretic compromise by accepting the creatorlessness of Jainism, rebirth of Hinduism and Jainism, but denying the soul and de-emphasizing metaphysics and ritual. Yet it is the natural history of religion that it acquires the accretions of philosophical and metaphysical dirt, as it rolls down the slope of time, in its meaningless and futile quest for legitimacy.
Christianity was an attempt to reform Judaism. Christ had to portray himself as the Messiah to appeal to the Jewish population with a strong belief in the coming. Islam was developed to appeal to the less sophisticated, uneducated poor and thus accepted the prophets of Judaism and Christianity. Mohammed toyed with the idea of accepting local goddesses, until his strong misogynistic tendencies precluded such a compromise. Thus the poor and less valid status of women in Islam, as mere objects of desire and carnal rewards for libidinous males on earth or in heaven. He chose to give importance to a shapeless stone, because rejecting everything would not have brought him followers even with a sword. He thus retained the primacy of Mecca. Sikhism was an amalgam between Hinduism and Islam.
Thus the major religions were following the same pathway as evolution and like all things were to some extent constrained by their past, development and genetic content. So are pigs constrained by their genetic and environmental history and baggage. Such bottlenecks have prevented them from developing effective wings to fly with.