Piggybacking on my earlier notions about science, religion, and nuance. I'm currently re-reading The Dragonlance Trilogy (because after The Mirror Empire I needed something a tad simpler), and noticed C. S. Friedman's Black Sun Rising on the "dear to my heart" section of my bookshelf, and was struck by how differently religion functions in these two stories. Between the two series, there are three approaches to religion, highlighting some of the ways religion is presented in Fantasy stories. In Dragonlance, religion is in some ways simply the functional power it represents in D&D, but also more broadly an assumed characteristic of all people. Black Sun Rising in contrast, presents religions that have grown up in response to their environment, and shows individual responses to those religions. My favorite treatment of religion in Black Sun Rising (and the entire The Coldfire Trilogy) is that while acknowledging the world it exists in, elements of the religious faith stretch beyond the world.
(There's a giant disclaimer here - I am familiar primarily with western Christian beliefs and practices. I grew up in the Presbyterian church and studied medieval Christianity in college. My goal here is to talk about the ways religion is portrayed in fiction, but to the extent that I'm referencing real-world religious experience, that's the limited context I'm drawing on)
Religion in Dragonlance is mechanistic (it is, after all, based on an RPG). Gods provide healing power. Wizards do magic, but can't heal. Clerics can heal. It's a bit interesting because all of the gods left a long time ago & have only recently returned, so there are a bare handful of priests around, but basically by identifying as a religious figure (Cleric in D&D terms), the character can use magic to heal & is affiliated with a specific god. Period, end of sentence.
Except that it's not quite that simple. The entire impetus for the companions' original excursion was to seek evidence of the old gods, and there's no indication that this was just because they thought the world would be better if more people could cure light wounds. The major new power in their lands are the Seekers, a group based in a nearby town that claims to be seeking out new gods. Dwarves and Elves at least claim to remain devoted to their gods, even though there are no clerics in their communities. Central to Weis & Hickman's view of society, then, is a notion that religion & spirituality must exist. There's no theology in the series & no ritual, but there is a notion that people will seek out gods. It's just not quite clear what "religion" is.
Compare Black Sun Rising and the rest of The Coldfire Trilogy. People have crash-landed on a world where a mysterious power (the fae) makes technology not work but allows them to do magic. Of course, there are also magical demons who feed on humanity in one way or another. In this world, Friedman shows a society that has grown and developed for centuries after the landing, but also a few glimpses of the early days. In those early days, many of the demons formed by people's unconscious came from religious traditions and half-remembered childhood tales. Centuries later, however, people have come to terms with demons in various ways. The demons are classified & understood to a large degree. Some have developed symbiotic relationships & are even worshiped by many residents. A church has grown up, based on the rejection of the fae. Friedman returns frequently to the notion that an important aspect of this faith is that the church does not expect miracles. Surrounded by tangible, common, magic, the church has defined itself as stretching itself towards a world not ruled by these spirits.
Black Sun Rising highlights one of the key challenges many fantasy series struggle with. When wonders, magic, monsters, and gods exist within the universe, often in ways that have been defined and contextualized, how will religious faith be different from what we experience here where miracles are less prevalent? Many series portray gods and worshipers, but Friedman's Coldfire Trilogy is one of the few I can think of where a religion has sprung up seeking a consolation that is manifestly not available within the world. Not founded on divine revelation or miraculous events, the church of the Coldfire Trilogy presents what I think is really an interesting and nuanced view - a striving towards another world, where the grass is greener.
Another thing I appreciate about Black Sun Rising (and particularly the later books of the series) is that different believers have different experiences of the faith. In my own life, I've known people (believers and not) who have attended church for the community it provides, people who engage deeply with the theology and rituals of their church, and people who identify as religious without attending an organized congregation. Rarely are the faithful a homogenous group. Within The Coldfire Trilogy, there are people of greater and less faith, people with different methods of reaching the goal, and those who attend a church seeking a consolation other than the promises of their faith. The diversity of the members of the church is another strikingly positive aspect of The Coldfire Trilogy. (Undercut a bit by the presentation of the church on the eastern continent in book 2)
Even fantasy series that present "religion" in some way have wildly different ways of portraying it. For many series, as in Dragonlance, religion may be assumed without great attention to either ritual or theology, or alternately "religion" may just be another supernatural element of the world like wizards. Fantasy series like The Coldfire Trilogy that present a nuanced, heterogenous group of the faithful, and a religious experience that truly looks outside the natural confines of the world are rare, and I like to celebrate them.