Disclaimer: I know religion is a touchy subject, so out of respect, I've tried to stay away from naming active real religions in the real world. Hopefully I didn't overstep anywhere in this post. While I'm probably not going to mark this as a (+) thread because I want there to be a discussion of identity of deities in D&D, please remain courteous to other people and stay away from discussing real world religions as much as possible.
Gods have been a part of D&D for a very long time. According to Wikipedia, the first D&D product to officially detail gods was
Gods, Demi-Gods, and Heroes, published by TSR in 1976, about two years after D&D was first published. The book heavily focused on mechanically translating gods and mythical creatures/heroes to the game, some from real-world pantheons and some stolen from the worlds of Elric and Conan. It gave short descriptions of the gods and their abilities, typically around two paragraphs in length, and the book assumed that the gods existed and could be interacted with in worlds other than Earth. Not much was said about the nature of godhood and how the gods existed, as the focus was on providing rules for the gods, not explaining how to include them or why they would exist in your game. It wasn't until AD&D's Deities and Demigods was published in 1980 that D&D's pantheons and rules of worship were codified in a form that has stayed relatively consistent through the editions (please correct me if I've missed something or made a mistake).
Deities and Demigods introduced the idea that divine powers were divided into different levels: Greater Gods, Lesser Gods, and Demigods. It also introduced the idea that clerics at least partially gained their power from their faith, not purely from deities rewarding them with spells, and that worship is required to achieve and maintain apotheosis. The book even recommends taking the control of a character away from a player if they somehow become a god or demigod. Thus began the "Gods as Tulpas" phase of D&D, where worship itself had inherent power, which was further detailed in the Planescape setting.
However, these ideas are not completely true in all D&D worlds. In Dragonlance, the gods went without mortal worship for over 350 years after the Cataclysm without losing their status as gods. In the Forgotten Realms, Ao the Overgod doesn't need or
want worship, which is proven in the Time of Troubles. In Eberron, the existence of the gods is debated both by scholars and theologians in setting and fans of the setting. In Exandria, the pantheon (which uses the Dawn War Pantheon plus a goddess from Pathfinder) seems to have mostly been around since the beginning of the world, and worship doesn't seem to be a necessary part of godhood (evidenced by the fact that the Raven Queen become a goddess by usurping the former god of death with a magical ritual). In Theros (originally a M:tG setting, but is still an official 5e setting), gods do gain their power from worship and mortals can become gods if enough people worship them, but there seem to be some gods that have been around forever without the need of mortal worship (Kruphix and Klothys).
However, there are settings where most gods seem to be Tulpas, but most of the fantasy races were created by gods, causing chicken-and-the-egg question that a lot of settings do not address. If the gods created the D&D races, and the gods only exist because worship gives them power . . . how did the gods exist to create the races? Or how did the races exist in the world to create the gods? Some D&D worlds don't even give an answer to the question if the gods exist, much less answer this question. This issue is what spawned the idea for this thread; finding a way to reconcile the "What came first, the God or Mortal Races?" question, taking inspiration from a lot of different worlds to find a possible answer, and delving into the definition of deities in the many worlds of D&D. This is largely an issue with worldbuilding, but also could be brought up in games among philosophers, theologians, and other scholars that have disagreements on the answer.
Category #1: Gods as Tulpas
"I don't hold with paddlin' with the occult," said Granny firmly. "Once you start paddlin' with the occult you start believing in spirits, and when you start believing in spirits you start believing in demons, and then before you know where you are you're believing in gods. And then you're in trouble."
"But all them things exist," said Nanny Ogg.
"That's no call to go around believing in them. It only encourages 'em."
In this type of world, the gods are tulpas (magical creatures that were originally imaginary, but became real due to people believing in them enough). Humanity (and/or the other fantasy races) existed before any gods, created religions and started worshipping gods that didn't exist, until eventually the worship became powerful/potent enough for the gods to actually start existing as extremely powerful, sentient, magical creatures. Theros, Discworld, and Planescape more or less fit into this classification, where most of the gods and god-like entities were created by the worship of mortals, not the other way around. As for how the sentient mortal races came into existence before the gods did, the answer can either be through natural evolution, or they could have been created by other powerful creatures that aren't technically gods (like the Primordials from D&D 4e).
In these worlds, the gods are basically glorified imaginary friends. They're figments of the imagination that got enough worship that they became real. A lot of the times in worlds like these, gods will actually change over time based on how people worship them changes. In the real world's history, the identities of gods changed as they were worshipped in different ways. For example, Poseidon was originally worshipped as the god of the underworld, the leader of the Mycenean gods, and husband of Demeter, but how he was worshipped changed so much over the course of several hundred years that he stopped being the Top God of the pantheon, became the god of the seas and earthquakes, and was married to one of the Nereids instead of Demeter. The same thing would happen in a world where gods are tulpas, causing certain gods to completely change in their divine portfolios over the course of hundreds of years. Tharizdun could become a god of alcohol and partying. Tiamat could become a goddess of trade and merchants. Pelor could become an evil god sunburns and skin cancer. The identity of gods would be as fluid as culture is. Their religions, identities, and lives could change as easily as the people that worship them do, just like in the real world. So, while gods in this type of world can often be very powerful, they're ultimately also dependent on the worship of mortals. So they're less likely to commit any acts that would destroy the world or kill a bunch of their worshippers (Eberron's Mourning, Exandria's Calamity, Krynn's Cataclysm), because that would make them less powerful, potentially even killing them. At best, they try to gain worshippers by being benevolent. At worst, they're energy vampires that feed off of your worship in order to make the world a worse place.
I enjoy worlds where the Gods are Tulpas, because it feels familiar to how religions and mythologies from the real world evolve and gives a clear definition of what a god is: a being of divine power created by mortal worship. The fact that mortals get to influence gods in these types of worlds is an idea that I've been meaning to play around with for awhile now. I just think that it's a fun balancing force to have in the world that can echo some aspects of the real world (churches could have religious "unions" that negotiate with their gods and even make demands).
Also, I just recently read
Small Gods by Terry Pratchett, so these types of gods have been on my mind and inspiring my worldbuilding a lot lately.
Category #2: Gods as Progenitors
These truths the Maker has revealed to me:
As there is but one world,
One life, one death, there is
But one god, and He is our Maker.
In Category #2 worlds, the gods are progenitors. They existed before and created humanity and the other fantasy races. They probably created the planets and other planes of existence, too. And, unless there's some in-world justification, don't need worship in order to continue existing. Humanity and the other sentient races often worship their patron gods as parental figures, some races choosing the god(s) that created them as the main deity that they worship (Gruumsh for the Orcs, Moradin for the Dwarves, etc). Worlds that fall into this category are Exandria, Krynn, and maybe Eberron if you count the Progenitor Dragons (otherwise, Eberron firmly falls into Category #4).
In these worlds, the gods can feel more similar to how gods from real world religions have been worshipped. They're magical creatures of immense power that have been around longer than basically everything else in the world. Their word is absolute, mortals normally have no power over them, and since they aren't giant energy vampires, they can nuke all of the people that worship them without any major personal repercussions (barring stuff like "divine contracts" that restrain the gods of the Forgotten Realms and Dragonlance).
I enjoy worlds where the powerful entities that are worshipped were involved in the creation of the world (and its people). It helps evoke myths from a lot of real world mythologies that I grew up with. And having the PCs meet or talk with the god(s) that created the world will never not be cool.
Category #3: Gods via Apotheosis
I am, unfortunately, the Hero of Ages.
Holding the power did strange things to my mind. In just a few moments, I became familiar with the power itself, with its history, and with the ways it might be used. Yet, this knowledge was different from experience, or even ability to use that power.
For instance, I knew how to move a planet in the sky. Yet, I didn't know where to place it so that it wouldn't be too close, or too far, from the sun.
Most D&D worlds do have some way for mortals to become gods, but don't choose this approach as its main source of gods. As far as I'm aware, it's only been built in to the core identity of a single official world (the Immortals of Mystara), but this answer helps evoke a different theme and stories than the other types of worlds. Dark Sun might count, but becoming a Dragon or Avangion doesn't really count as becoming a god, even if it is ascending to a higher state of being.
In Category #3 worlds, "godhood" is a status to achieve, not a consequence of mortal worship or constant fact of existence. So many settings include some form of apotheosis that it's just not worth mentioning all of them. However, this option is kind of built-in to the core of D&D in some editions, where the PCs eventually gain godlike abilities at higher levels. It would be pretty easy to make a world where all of the gods used to be heroes or villains that gained enough magical power to achieve apotheosis. As I said earlier, similar stories have happened (or are in the process of happening) in a lot of D&D worlds (the Raven Queen, Mystra 2.0/3.0, Vecna, Raistlin, etc). This style of world could be good at making the players feel like they have a long-term goal and reason to keep playing after the main quest is finished (assuming that the main quest doesn't already involve their apotheosis). D&D could do better at supporting high-level play, and building in options for apotheosizing the PCs and allowing them to punch the other gods in the face and take their stuff is a logical evolution of a lot of D&D campaigns.
Category #4: Gods as Unknowable
Also known as, "the Eberron approach", Category #4 worlds are where the gods are not known to exist. As I've said, Eberron is the main example of a Category #4 D&D world that comes to mind, but there's at least three other D&D settings where this is true: Ravenloft, 2e Dark Sun (I know 4e Dark Sun had gods in the ancient past), and Ravnica (yes, I'm counting Ravnica). This category isn't much like the others, because the other categories are objective answers in the setting about what gods are. Category #4 is just
The Shrug of God about whether or not gods exist in the setting. The Deity Dilemma in these worlds has an answer, but the answer just isn't known, and is up to the DM to decide. Clerics, Paladins, and other religious characters in Category #4 worlds, like in the real world, have never seen their god and don't know if they exist. In Ravnica it's stated that there used to be religions that worshipped gods, but whether or not those gods were real is up for debate. In Ravenloft, it's speculated that Ezra's clerics actually get their spells from the Dark Powers. In Eberron, even the angels that claim to serve members of the Sovereign Host admit that they've never met the gods they follow. Keith Baker has even said that if a god from the Forgotten Realms were to travel to Eberron, most people on Eberron would reject their claims that they're a god and refuse to worship them, because they disagree on the definition of deities.
There are obvious benefits to this choice. It makes for more diverse types of religions to be possible/common in the world. It's familiar. You can still have stories about the gods and religious characters in the game without confirming if the deities exist or not. There are some trade-offs made when you choose to make a Category #4 worlds, but depending on the execution, it can be well worth it.
(Sidenote: I've had this idea recently of a setting where gods get power from their worshippers, but only once the worshippers die, as their souls are then absorbed into the god and assimilated into their consciousness. Like the
Mindhive trope, but on godly proportions. I'm not aware of any D&D worlds where the gods are actually just the amalgamated souls of dead people, but I think it would be cool. If there are any old D&D settings or 3rd party settings that use this model of gods, please let me know. If there aren't any yet . . . I might have to do something about that.)
To conclude, D&D settings don't have a consensus about how religion and the gods work. It tried to for awhile, but that was made permanently impossible with AD&D having settings with diametrically opposed takes on religion and deities, which was further cemented by Eberron in 3.X. Core D&D's take on religion has changed a lot through the editions and some settings have blurred the lines between the categories. Some were always in-between two or more categories (Dragonlance seems like it should easily fall into Category #2, but it has aspects of Category #3). Some settings started in one category, but shifted into another later on (the Forgotten Realms started in Category #2, but shifted into Category #1). D&D's information on religion started out as a "here are some gods we took from the real world and some stolen from IP that we don't own, use them as you wish in your games", and eventually evolved into a complex, nuanced, and often infuriating mess of contradictions and overlap that adamantly refuses to fit into nice and precise classifications. D&D 5e's DMG guidelines on the topic just tells you about different types of religions, gives you a bunch of examples, and tells you to figure out how it works in your world (which is good for supporting different views and options, but probably not good at accommodating new DMs and players that just wanted to know how religion works in D&D).
As stated earlier, please be kind and respectful. Feel free to correct me on anything that I got wrong or add more categories that you think I missed (I cut out some because they had too much overlap with the other categories or just weren't common in D&D). Oh, and if you've made a world or played in/DMed for a setting that uses one of these "divine classifications", please feel free to share your experience here and how it affected things.