Because gods are real, and because magic works, religion constitutes a magic system. The exact expression of this magic system is dependent on the nature of the religion, the nature of the gods, and the nature of humanity's relationship to the gods. I could easily write a book on this topic by itself.
The important thing to keep in mind as you think about religion and magic is that magic can be anything seemingly fantastical. The nature of magic extends far beyond ceremony and spells. Any aspect of religion which has a supernatural effect on the world, or prevents a supernatural effect upon the world, can be interpreted as magic.
While it seems as if the gods can do anything, in practice, most magic deriving from religion is limited. Magic exists as an aspect of divinity and not as a wildcard. Even in monotheism, where God can do anything, God usually chooses his miracles from a fairly short list.
The act most usually associated with gods, especially good gods, is healing. This comes from the monotheistic tradition where healing is among the most favorite of miracles. Because healing and faith are intertwined, he who is holiest, who believes and acts closest to the ideals of the religion, healing not only provides benefits to the healed, but demonstrates the fundamental holiness of the healer. This was not necessarily true on the pagan world, where temples weren't very interested in healing or helping anybody. When Christianity showed up in Rome and and began out-competing the old pagan religion, the temples were slow in realizing that Christianity had built a community that helped itself, that aid and assistance were fundamental to its expression. The temples were more akin to business, money harvesting schemes over the populace. Thus, we see Jesus's scorn of the Temple in Jerusalem.
Ceremony and religion go together like cooking and fire, so integral as to be assumed. Through ceremony, things happen. The ceremonies must be right. The timing must be correct. The words must be performed without flaw if the gods are to be propitiated, if the sun is to arise again in the morning, if the dead are to go to their rest, if the king is to rule strongly, if the crops are to thrive. In ceremony, nobody is special, it's the words and actions themselves, independent of any single person, that creates the result. These ceremonies can be simple or complex, or they may be religious theatre with some other driver behind the magic.
Oracles have been associated with temples since forever. Some of the oldest archeological structures known are solar observatories, allowing the tracking of stars. Shaman used their magical powers to travel the world of the gods to learn answers needed by their tribes. The magi of the middle east were priests who studied the stars, to learn something of the god's will. Prophet were people gifted to speak for the gods, be it in plain words or glossolalia. Oracles seemed to be everywhere. Roman armies even marched with their own herds of sheep so that their entrails could be read. The list of ways to determine the future is staggering.
Warrior powers were another area of favoritism. Every armed man wanted an advantage, seeking some special way, be it talisman, blessing, animal spirit, or internal perfection to win the day. For some warriors, such as in the Germanic traditions, how you died determined your place in the afterlife. Many went into battle expecting to not live, literal human self-sacrifices.
You can't divorce the seasons from religion. With the growth of crops being such an uncertain and hazard prone endeavor, good relationships with the powers of the world proved prudent. In this case, one sought to prevent the expressing of magic, such as locusts or pests, and well as encourage other expressions, such as rain.
Then there are the dead. Almost every religion has somebody who's good at solving the problem of ghosts and spirits. Through whatever combination of powers that they have, they save the ordinary person from the extraordinary. These professionals are often not associated with the biggest parts of religion, such as the temples, but more associated with the ordinary person.
Where do these powers manifest? Place matters in religion. Holy ground indicates a place that is literally different than everywhere else in the world. Holy places grant access to powers that would ordinarily be inaccessible.
There are holy objects, like holy places, except more portable. Holy objects have power to them, and those who have them have access to those powers. The Ark of the Covenant is a very famous example of a miraculous holy object.
Vows before the gods gain a special place, as you've made a promise before a god, and the god will hold whoever breaks that promise as guilty, or at least a failure.
Crafts and skilled professions often have magic-like characteristics. A smith uses fire and water to transform rock into iron. In many society, this process begins with a sacrifice, because they perceive this act as partly or wholly divine. You are literally transmuting one material into another. For those societies, smithing is magic, and the practitioners protect their craft as if it were a religion.
If the gods are part of the fundamental fabric of the universe, so are their children. Quite a few heroes, villains, and monsters trace their awesomeness back to their divine parentage. In this case, the fantastical is acquired through bloodline. One has literally been born to power, such heroes often strangling dangers in their crib as an omen to their awesomeness. Meanwhile, other creatures are born far more disastrously, monsters from the very beginning, their powers and appetites offensive to civilized society.
Mind-alternation, whether self-induced or chemically induces, provides access to both information and other-worldly experiences. Whether it be by mediation, magic mushroom, or out-of-body experiences, these experiences grant humans access to realms and perceptions otherwise unavailable.
The dead makes up some part of every magic system, as people who don't stay dead cause problems for a living, be they ghosts, vampires, or other sorts of restless spirits. Proper burying of the dead is vital, and when that doesn't happen, you need an expert who can straighten that out. Psychopomps make sure that the dead souls get where they need to go, while a variety of professionals deal with restless spirits.
Beyond real life, the power of gods in fantasy is real, so the power of priests in fantasy is therefore significant. Such priests can summon otherworldly creatures, beg a miracle from a god, and at time even discover the foundations of the universe. The power that priest represent is not merely hubris. Their labors ensure that society remains favorable to the gods, which helps keep everyone prosperous. Once you're in a bad way with the gods, they'll surely turn against you, everyone's fortunes will fail, and your society may just fall to the forces of anarchy called your neighbors.
It's important to note that a world created by the divine is divine. The world is a direct magical expression of the gods, in some way or another, depending on the theogony. Therefore, delving into the secrets of the world is delving into the secrets of the gods themselves. In this respect, there is no difference between magistry and religion. One is an aspect of the other. "Mage" derives from "magi," the middle eastern professionals who studied the stars in a effort to understand the gods.
Naturally, fantasies have gods quite unlike those found in real life, and the gods have powers quite unlike those found in real life. The nature of what's worshipped and the powers that grants bends what's possible to any degree desired. Elemental gods would grant elemental powers, for example, or not, depending on what you want. A priest might be able to command fire, or a priest might just be a bureaucrat while only prophets can command fire.
Because gods represent what is most important to a society, scaling downward as importance lessens so the magic that these gods represent will also be important to society. In a world of fire, where humans barely get by, worship of fire and the ability to keep fire at bay, enough to grow crops and not burn like a crisp, the magic gifted by those gods of fire would would most guarantee that survival.
Who gets which magical powers is the most interesting question in setting up a divinely based magical system. The people who have these abilities might be easy to find but hard to get to, such as in a temple downtown, or hard to find, because they live on top of a mountain. They might wander, like a gypsy fortune teller, or be world famous, like the Oracle of Delphi. This simple fact of deciding who can use these powers, and what it takes to access those powers, will provide the biggest impact on the overall feel of your work, because that determines what your characters need to do and why they need to do it.
Return to: Religion in Fantasy