For a lot of people, I think religion provides this basis or promise of harmony with the world, in a simplified way that stipulates what you should or shouldn't do and how things work, and those people find comfort in having these clear "rules"; we want to be able to rely on our understanding of the world, so that we can act within it with confidence, or faith. Ultimately, the "god" that is present in many religions is synonymous with this absolute truth of how the universe works, it's an unattainable standard that we all try to aim for, intuitively and knowledge-wise, or seek wisdom from, and I believe the intention of prayer is to have a way to get closer to it, to tune the self to the god in order to sense and know this absolute truth more clearly. I reckon that conceptually, prayer and meditation are very similar in this sense, but with a focus on different areas of the self.
If "god" is synonymous with the absolute truth of how the universe works then it can't address moral issues at all, since you can't prove an "ought" like "people shouldn't stab people" from an "is" like "stabbing hurts people and may kill them". You need to add extra axioms like "hurting people ought to be minimized".
The universe (and its intrinsic functions) holds no special value for people or trees or life in general. The best we can say is that it seems to have a slight preference for matter over antimatter for some reason.
All our moral codes and social norms we live by are purely human invention, derived from things that happen to work to produce a somewhat functioning society.