Religions are based on the same core insight, the perennial philosophy, that we are not separate from the world around us and that thinking we are is the source of our suffering.
This insight was experienced by exceptional individuals, Buddha, Christ, Muhammad, and the principles of what they discovered were shared, usually in a simplified, concretised, watered down form to make them accessible.
Over time these initially helpful practices are turned into rules and dogma (by rule keepers who thereby achieve power and who often interpret the rules differently even within a religion) and we arrive in the position that “if you don’t follow the rules you can’t be in our team”.
Sadly this reinforces the idea of separation and we end up where we started, suffering.