My setting has only a few elements from the standard D&D cosmology (the Positive Energy plane ('life energy') (but not negative; 'negative energy' (i.e making undead) is just a 'perverse' use of life energy in my setting), as well as the Ethereal ('world of magic') and Shadow ('spirit world') planes).
Now, all of this is rooted in the prehistory, which goes as follows (or so the dominant church/philosophy goes at the time)...
There was a single sentience that existed in an 'age' before time and space existed, and it/he/she was called Uru. Uru, after an eternity of contemplation, 'invented' time and space, thus creating it. Uru was destroyed in the process, but its/his/her body formed a lifeless sphere of rock and its/his/her mind went in all directions in the form of the stars.
Four entities coalesced from Uru's spirit; Urui, Yril, Dorn, and Lyri. Yril bound herself to the soil of the lifeless planet; Dorn took up residence with the fire in the world's heart; Lyri and Urui ruled over the sky.
It was lonely and dark on their little world, so Dorn forged the sun and Urui cast in into the sky. Lyri took rocks from Yril and created the oceans to repay her. With Dorn's help, she created a palace for herself; the moon.
With the light and warmth of the sun and the moon, Yril was able to create plants and animals, and the world--Yril--came to life. For an eternity the Four marvelled over their creations, but the plants and animals were beginning to become to numerous for the Four to watch over alone, so Urui created the Nayr from his own essence; divine servants.
The Nayr watched over the children of Yril for another eternity, helping them to grow strong and beautiful.
After that, Lyri and Dorn created the elves and dwarves--far less powerful than the Nayr, but with free will. Some of the Nayr became jealous of the elves and dwarves, so they rebelled from Urui and started the First War. The world itself was scarred, and the rebellious Nayr were all but destroyed; many escaped and went into hiding.
After that, Urui and Yril created the human race together, and all of the Four left the world of mortals, occasionally sending Nayr as observers.
Everything from there is in the grey area of early human existence, and many thousands of years later, humans began recording history. While the dwarves and elves recorded their history countless millenia ealier, all of it was lost when both races all but destroyed each other in the War of Elves and Dwarves, which took place while humans were on their rise to power. It also should be noted that other races arose from Yril's animals, as well as the vile experiments of the fallen Nayr.
Wow, that was long. I think that just about covers it, though...
Now, in 'scientific' terms, the gods made the world livable a few billion years before humans were created, let the 'plants' and 'animals' evolve from simple single-celled organisms, and then humans went for about 50,000 years before civilization took off (and then about 5000 years before written records really began, and 5000 more years before 'campaign standard time'.