« Given this, why did humans need religion to bolster morals and social cohesion? »

I would say it the other way round : the fact that humans acquired (gradually, over long period of time) specific beliefs about the world around encouraged them to take advantage of this « knowledge » to interact with the world around following specific rules. The groups which worked with “inadequate” (in terms of survival) beliefs slowly disappeared or weakened.

Therefore, humans do not need religion to bolster morals & social cohesion. Atheists, like any human follow rules, and contribute to social cohesion.

Humans need to live with a set of beliefs & rules which is preferably consistent with their understanding & Vision of the world. That is why these sets of beliefs are so different from one place to the other. And the morals Values differ as well quite a lot. So does the Rules.

« You have a chicken and egg problem. »

Well, I am not sure of that. Often the problem do not lie before our eyes, but behind ! (in our brain)

« Alternatively,… »

Well, my feeling is that, often, things which we expect to be « black or white » happen to be « different shades of blue, with yellow spots ».

You know that whales have wonderful « songs » which are also means of communication. It is now scientifically documented. Each group of whales has his own selection of songs, which also enables the group members to identify each other. Whales travel over thousands of kilometers at sea. It occured that a single whale within a group « invented » a new variation in the group’s songs. After some time, the group members ave adopted the new variant. When the group crossed the path of another whale group, some members of the other group adopted the variant as well.