The first gods to exist, in unknown order were; Beory (Oerth itself), Pelor (god of the Sun and Healing), Nerull (god of Death) and Tharizdun (The mad god). Many hold Tharizdun was first, alone and mad in the darkness. When the others arrived he desired their death because he could only stand being alone. Soon all the gods came into existence. How that happened is a matter each group’s theology addresses. What all agree on is that soon Tharizdun attempted to kill all the other gods.
The Demihuman Deities
Before the Mad god attempted to destroy all others there also arose the god of the Elves, Dwarves, Gnomes and different demihumans. The Gnomes insist they are not from Oerth and their home is elsewhere. They are the last race to arrive on Oerth and their claim seems likely. The Elves and Dwarves, however, say that across all the planes of existence and the worlds, Oerth is their home. And much evidence backs their claim. The Dwarves were not born, but forged, by Morradin the All-Father.
The Elves came about due to a battle. When the father of all elves, Corellon Larethian, came to be he was met by the father of all Orcs, Grummnsh. An immediate hatred was born and the two fought across Oerth. Where their blood fell, elves and orcs arose. Corellon took Grummnsh’s eye and as the battle reached a climax the god war erupted.
The Mad God
Desiring to be the only thing alive, and some believe it wanted nothing alive at all, Tharizdun attempted to destroy all life. So great was his power that it took the collected might of all gods, human and demi-human, good, evil and neutral to subdue it. They cast it into a deep sleep and locked it in a prison beyond the known planes of existence. No one knows where that prison is, but no one on Oerth will speak the name Tharizdun. Because if you do, it wakes slightly and hears. Even in prison and asleep, the mad god is not powerless. It answers the prayers of it’s few mad followers.
The God Pact
After the war, the Gods agreed that they would not interfere in the affairs of Oerth directly. Should they come to battle, they knew full well, everything would be destroyed. Some leeway is given to the elves and orcs since they are made from the blood of their gods. For these races the relationship is closer. For humans, except on rare occasions, all interaction is through the clerics and their ability is limited to some degree. This pact only binds all gods except for Beory since she is Oerth itself. It also does not bind a god who was once a human. This flaw of the pact would eventually undo everything.