The following contains spoilers for Episode 5 of Raven of the Inner Palace, "Confidant," now streaming on Crunchyroll.

As a historical court drama, Raven of the Inner Palace is no stranger to traumatic backstories. Some of its tension so far has been built around Emperor Gaojun's and Shouxue's loss of their respective mothers during their childhood, as well as the surrounding conflicts they each had to endure as they rose to their positions. Episode 5 reveals the startling childhood memories of another character: Emperor Gaojun's aide, Wei Qing.

Known as Ei Sei in Japanese, Wei Qing is the eunuch often seen by Gaojun's side, especially accompanying him during visits with the Raven Consort. While his faithfulness to Gaojun is a given due to the latter's position as Emperor, he exhibits even more care than would be expected, as he is both deeply loyal to Gaojun and unafraid to express his concern. He also does not tolerate any disrespect toward Gaojun, putting him at odds with Shouxue, who often protests the Emperor with snide remarks. However, as Gaojun's nightmares continue to plague him, Wei Qing struggles to decide whether to recruit Shouxue for help and chooses to investigate himself, leading him to the red-light district where he confronts his past.

RELATED: Sweet Bite Marks Is a Smashing New Donghua Perfect For Vampire Lovers

Wei Qing's Traumatic Backstory Explains His Friendship With the Emperor

Raven of the Inner Palace ep 5 Gaojun and Ei Sei / Wei Qing

As part of his investigation of the Emperor's ghostly nightmares, Wei Qing volunteers to travel to the red-light district to search for a sorcerer. He struggles to find information on the sorcerer, enduring flashbacks of his childhood that escalate as familiar scenes and faces invade his vision. The usually stoic man is overcome with sickening emotion as he recalls disturbing memories. Wei Qing was born in the red-light district to a prostitute who killed herself after his father backed out on his promise to buy her and make her his mistress. As an orphan, Wei Qing had to choose between becoming a male prostitute or a eunuch, and though he chose the latter, he still endured sexual abuse. Young Gaojun found and rescued him, making Wei Qing his aide.

According to Wei Qing's memory of Gaojun's intervention, the young boy not only saved him from a horrible situation but also gifted him with a new identity and lasting kindness. While Gaojun's position as the Emperor certainly does factor into Wei Qing's level of respect, he serves Gaojun and protects him so faithfully out of deep appreciation and friendship rather than just status-motivated obligation. Episode 5's focus on Wei Qing and his backstory helps viewers better understand the depth of his character and motivations.

RELATED: The Little Lies We All Tell Might Be This Season's Cutest Comedy Anime

Wei Qing and Shouxue Set Their Differences Aside to Help Emperor Gaojun

Raven of the Inner Palace ep 5 Shouxue and Ei Se / Wei Qing

Because Shouxue doesn't make a habit of holding her tongue around the Emperor, Wei Qing isn't very fond of her. He is especially wary of her due to the mystery that surrounds her origins and role as the Raven Consort. Wei Qing often chides Shouxue for being rude to Gaojun or expresses his concern that Gaojun is much too trusting of her. Troubled by Gaojun's frequent nightmares, Wei Qing pays Shouxue a visit in Episode 5, but reminded of his disdain for her and Gaojun's request not to tell her, he refrains from requesting her help. Instead, he expresses his belief that she will end up troubling the Emperor, sparking even more animosity between the two.

However, after investigating on his own and encountering memories of his childhood trauma, Wei Qing comes face-to-face with the ghosts himself. Though the Emperor's constant nightmares are concerning enough, Wei Qing seeing them for himself reminds him of the critical urgency of the situation, as they are more than just nightmares. Wei Qing visits the Raven Consort once again, this time humbly apologizing for his temperament. After the two make amends with each other, Wei Qing fills Shouxue in on the Emperor's situation, preparing her to help relieve him of the ghosts.

Though she is concerned for Gaojun after Wei Qing's visit, Shouxue takes a detour before approaching the Emperor. The episode ends with Shouxue aghast at the sight of a map, but fans will have to wait for the next episode to discover the map's significance and see how Shouxue handles Gaojun's haunting.