Ok so if you've seen the drama you know what the ending is like. It's very confusing but it held my interest. I'm doing this since there will likely never be a sequel and I want to try and understand this mess myself too. I'd love to receive feedback if someone has other ideas about it.

Only read this after completing the story, otherwise you'll just be very very confused. 

In a few words: What you're about to read is like a romance-themed Matrix disguised as a slapstick period-drama.

The background story of the emperor and the sky demon queen:

The story starts in the mountains where leader He Sang of the Sky Demons saves the royal human Wu Geng with her magic. Wu Geng uses the love of He Sang and kills people with her help. She decides the best course of action is suicide (People in this drama get very blinded by love) to make him regain kindness. The sky demons are without a leader now and their immortal Guardian (bird-lady) has to protect them against human invaders. So to hide them the Guardian cuts off all the wings of the sky demons (among them is Da Xi) and they start some villages. The Guardian goes to the grave of their former leader and asks for help, a flower grows from the grave and Da Xi is chosen as their peoples hope (Western Goddess). 

(The former leader may just be really into romance more than saving her own people now that I rethink that scene based on later events)

Da Xi becomes queen of the wingless sky demons. Pretty soon after some humans are stealing crops from the sky demons and she uses magic to stop their swords. They eventually run away after attempting to kill her. Now the emperor shows up at her doors and he has this belief that he's the son of the heavens (typical royal attitude) and wants to defeat her because she used demon magic. He kills some sky demons and the Guardian sends in some ravens to distract the emperor. This is where the Guardian brings Da Xi to a cave and convinces her to do the illusion magic of their ancestors. 

The illusion dream magic is explained as ''entering the dreams of mortals''. Basically the plan is to ''alter their enemies dreamscape and make them lose their way'' so that one of his important generals dies and the sky demons can have a victory. Basically psychological warfare but Da Xi has to lose all her memories if she does the illusion magic. Here she says ''That's fine, it's impossible to forget anything that is truly important''. 

(Which basically suggests that she kinda doesn't care for the sky demon people based on the fact that she forgets her mission. It is romantic in the sense that she never forgets her feelings for the emperor tho. )

The start of the original story (Episode 1):

Da Xi forgets everything and is transformed into a famous cook in the capital who is really interested in finding an attractive husband. The emperor is somehow (I blame the mountain-spirit) informed about this planned illusion magic and he performs his own illusion magic with the help of a mountain-spirit to protect himself. He still doesn't escape the illusion world but his original self isn't influenced (thanks to memory-loss). This is where the story of Da Xi as a handmaiden and great cook takes place but after this things get complicated. Anyway, the emperor and Da Xi have lots of adventures together in their fake world where they didn't know each others true identity. They even soulswap once which helps them actually depend on each other. 

Da Xi is awoken by the Guardian after seemingly succeeding to seduce the emperor but she has fallen for him herself as well. She is informed about her sky demon past and the Guardian urges her to fulfill her mission. She goes to the emperor thinking he has real feelings for her, not knowing he's been protected from her illusion magic by using it himself. However, you can't do illusion magic without losing some of your memories. Da Xi has lost her original memories as a queen but the emperor lost his memories from the illusion world (besides the most recent event). One thing to clarify is that no one is truly in control within the illusion world they created, it's just that the emperor was able to block her influences (through his memory-loss) but it was still him who experienced everything. 

So when they finally meet she feels guilty about using him but he's just pretending he doesn't know her true identity. She explains her situation to the emperor and he basically tells her: ''Yeah I know who you are, I never loved you so you just got defeated. You're allowed to live though.'' He leaves satisfied with his conquest and Da Xi leaves heartbroken and goes to live with the sky demons. 

Then we cut to the emperor returning to his home victorious. However, he notices that something seems off, his memories of the illusion world start slowely returning and he starts seeking out his handmaiden Da Xi (Ironically, this is mostly thanks to the fact she was such a good cook that all other food tastes bad to him now). The story of Da Xi as the handmaiden isn't real but everyone in the palace has felt the effect of the illusion magic and still vaguely remembers her. The emperor notices that some of his memories don't match up with reality. The illusion-world memories have quickly overwritten his own and he ends up feverishly searching for Da Xi

The emperor finally finds her in some remote area but she still feels heartbroken over his betrayal of the love she thought they had. She has regained her sense of duty and tells him that they should seperate. The Guardian finds them and asks him to prove that he truly loves her, he gets zapped by her and we cut to the next scene. 

Waking up for real?:

(These next events are even more complicated than the whole first illusion-story. This is where a lot of people got confused.)

The emperor wakes up without memories in his bed after he got zapped by the Guardian. Apparently he has been in bed for three days with fever and has forgotten all about Da Xi however the whole palace still remembers her. Illusion magic doesn't take away memories of those effected, it only takes from those who use it (the emperor and Da Xi). He immediately goes outside and meets Da Xi who has also forgotten everything but he faintly recognises her and they end up walking together. 

The Guardian and mountain-spirit are seen stalking the two and discussing their love life. Talking about the effects of illusion magic (amnesia) being difficult to undo. This suggests that Da Xi and the emperor were in a illusion magic within a illusion magic. The first awakening of Da Xi was an escape from the first illusion magic and only recently the two have awoken for ''real''. This is shown by their memory-loss after awakening. It also looks like the spirits were just trying to see if they could get them together. 

(Can't blame them too much, I'd be doing that sort of stuff too if I was an immortal spirit stuck on a mountain with powerful illusion magic)

We enter the modern world: 

(After that ending we get something even more complicated (I know, it's unbelievable). 

Anyway, the Da Xi obsessed emperor randomly gets teleported into the modern world by likely the spirits. The power behind this isn't discussed. Now a popular interpretation of this is that the queen is reincarnated/reborn/teleported into the modern world. Thanks to illusion magic she forgot about him but still vaguely remembered enough to write a book about the story of the king and the queen. 

He runs into the author of his and Da Xi's story and she looks like Da Xi.  She's kinda weirded out but invites him into her home. When they wake up they've exchanged bodies again and that's where the story ends. 

The consequences of this ending:

This modern world with the ''author'' of the book might just be another dream/illusion world. Remember that the original soul exchange (with the thunder) happened in the illusion world within the illusion world in an early episode. I personally think the drama wants to paint the modern world as the real one but soul swapping makes no sense in reality. Is this just another layer of the dreamworlds? 

When we look at the skits that always end the episodes. These skits always show the emperor and Da Xi as a modern couple living together and seem seperate from the story. However, in episode 19 they switch souls again during the skit and state that it's a regular thing that happens. This can be them in the future, far after the ending of the show. Or it can be another illusion world. 

There really is no way to discern reality from dream within this drama. My personal theory is that the spirits are in control of the dream-worlds and just kinda following their love-stories over and over again when either of them gets amnesia again with illusion magic. The nice part about this is that both characters clearly state that they don't care whether they're in a illusion-world as long as they are together. So basically this might be an eternal cycle of falling in love in new worlds. 

Thank you for the great summary. I agree with your view. It’s a lot like inception Chinese Version. I think the real world is also a dream by the guardian and hermit because in the market scene they mentioned testing the Da Xi and Ji Man if they will find each other again. Sad and happy at the same time.

Thank you for reading it! After finishing the story I just felt like I had to seek an explanation since it gets very complicated with the different layers of realities. However, being stuck in an eternal cycle of falling in love over and over again isn't that bad. I personally don't know if I'd want that kind of life in endless dreams but at least they'll never be alone.