Gods are either the first beings who learned to harness the power of faith for their personal use, or beings who were born uber-powerful out of dumb cosmic luck.
Make no mistake, reality was there before the gods. The most ancient beings that dwell in hidden places remember the time before deities.
Reality itself was created by elemental forces, be it actual elements (water, fire, earth, etc) or ideals (good, law,evil, chaos, neutral).
The ideals however had no actual consciouness and just made things at random. Gods are sentient, and they sought to re-make the world at their image.
The material plane is their working ground, where they created the mortal races/animals/beasts, first as an experiment. But soon gods started meeting each other, as well as their creations met other god's creations, and the divine wars started, each god trying to make their own vision prevail.
Now Gods are mightiest inside their realms, but they're also static there. They're relatively safe, but also unable to grow in power. Their ability to affect the material plane is also quite limited from their own realm, needing to channel their own powers trough faithful agents, in particular clerics. A god can go into the material plane to adventure and grow in power, but that's extremely risky. A god doing so is either feeling really lucky or really desesperate. An avatar is a nice compromise on walking the land on terms of risk, but it still wields small evolution.
On the other hand, gods found out that after a mortal died, their soul would go to the plane most fiting to its actions in life. If things were carefully arranged, the souls would end up on a certain god's service. Now a single soul may not sound too much compared to the power of a god, but a million souls? A billion? A trillion? A quintilion? Stacking over the ages? Now that's considerable power. Plus, individuals that were more powerful during life would wield stronger souls. Gods thus do their best to watch over their flock, keep them faithful, and make sure they grow in powerful beings.
Gods also make alliances, treasons and conspiracies between themselves just like mortals, which they did create at their own image. Gods that fall out of grace of such unions can easily find themselves out of worshipers and wither to oblivion. New gods are usually mortals that managed to collect a vast amount of power, altough new god-births ouut of deity unions or spawning from ideals aren't unheard of.
And never monotheism(where would be the fun on that?), altough "god X suddenly gets much stronger than the others" is a good plot hook.