The Three Realms is the Universe that was created after Pangu's Primordial World was destroyed in the tribulation that came billions of years ago.
Pangu's Primordial world and the Seamless Primordial world's were both created from Autarch godgems. These godgems were merely 2 a set of 108,000 from Autarch Awakener who used a form of suicide to disperse them into the chaosverse.
During the tribulation that left the Primordial World in shambles, many Daofathers and True Gods, including Daoist Threelives, perished. Nuwa, along with other Daofathers, repaired the remains of the Primordial World to some extent and created the Three Realms.
The Deva Realm was created to be the most powerful of the three realms and act as an enforcer to maintain order in the Mortal Realm and minimize or even eliminate fighting amongst Daofathers and their legions.
The Mortal Realm was created to generate life inside the Three Realms as it has a vastly superior population than the Deva Realm due to its thousands of major worlds and trillions of minor worlds.
The Netherworld Kingdom was created to guide the souls of the deceased towards the Six Paths of Reincarnation to be reborn into the Deva Realm or the Mortal Realm or be tortured within the Netherworld Kingdom, itself, for eternity. This was decided based on whether one had committed more sins or more good deeds. It has thousands of Judges to decide upon this matter with the Lord of Cui Palace being the most powerful.