Plot
I. Childhood
Set during the reign of King Sukjong in the Joseon dynasty, the series is based on real-life historical figure Choi Suk-bin.
Dong-yi's father and brother are members of the Sword Fraternity, which is wrongfully accused of murdering noblemen. She hides her identity and enters the palace as a servant for the Bureau of Music, determined to reveal her family's innocence and find the true orchestrators of the noblemen's deaths.
II. As a court lady inspector
Dong-yi rises from the humble position of a servant to a court lady inspector through her shrewd investigative skills and relentless drive for justice. The court is split between the Western scholars (backed by the Dowager Queen and Queen Inhyeon) and the Southern scholars (backed by the king's favored concubine, Jang Hui-bin). Unaware of his true identity, she befriends the king and becomes a trusted confidante.
Originally, Dong-yi admires Hui-bin on the basis that both are clever, ambitious women from the common classes. However, she is horrified to realize that Hui-bin and her brother, Hee-Jae, are poisoning the Dowager Queen for refusing to acknowledge Hui-bin as a royal concubine. Hui-bin frames the innocent Queen Inhyeon for the Dowager Queen's death with false proof.
Queen Inhyeon is stripped of her title of queen and exiled to the countryside. Hui-bin takes her place as the queen, and her son, Yun, is declared crown prince. The Southern scholars are more powerful than ever. Dong-yi vows to find the evidence that proves the deposed queen's innocence and bring her back into the palace.
While investigating the Royal Treasury, Dong-yi discovers proof that Hee-Jae bribed officials and apothecaries to frame Queen Inhyeon. Before she can bring this evidence to the king, Dong-yi is gravely injured by Hee-Jae's assassins.
Dong-yi hides in a distant province as she recuperates her health. There, she discovers that Hee-Jae is involved in a conspiracy with the Chinese Envoys: In exchange for the Chinese Emperor's approval of Crown Prince Yun, Hee-Jae will give them military records of the Korean border.
Dong-yi escapes Hee-Jae and returns to the capital with proof that Hee-Jae planned to expose matters of state interests to a foreign government. The king is overjoyed to see her again, and he realizes that he is in love with her.
III. As a royal consort
Despite her commoner status, Dong-yi is brought into the court as the king's concubine. Through her new position, she exposes Hui-bin, Hee-Jae, and the Southern Scholars had contrived to sell state secrets to the Chinese Envoys to strengthen the position of Crown Prince Yun. Hee-Jae and the majority of the Southern Scholars are stripped of their courtly titles and exiled. Hui-bin should be exiled; however, as the mother of the crown prince, she is merely demoted to the rank of concubine of the first class. Queen Inhyeon is declared innocent and returns to the inner court as queen.
Dong-yi is highly favored by Queen Inhyeon for proving her innocence and convincing the king to reinstate her to her former position. Queen Inhyeon declared Dong-yi a concubine of the fourth class and an official member of the royal family. Dong-yi gives birth to the king's son, Prince Yungsu.
IV. The new Sword Guild and the past exposed
The Sword Fraternity is resurrected. Unlike their former iteration, they are violent and murder nobles who are involved in corruption and cause the commoners to suffer. Dong-yi fears that her identity as a traitor's daughter will be exposed, and she decides to investigate. She learns that the leader of the Sword fraternity is her old childhood friend, Gae Dwo-ra. She realizes that Lord Oh Tae-suk had murdered his fellow Southern Scholars in order to consolidate power and had blamed the Sword Fraternity, resulting in the death of her father and brother.
Jang Mu-yeol, a Southern police chief, realizes the unusual connection between Dong-yi and the Sword Fraternity. He realizes a chance to supplant Oh Tae-suk as the head of the Southern Scholars and remove Hui-bin's enemy, Dong-yi. He murders Oh Tae-suk and blames the Sword Fraternity for his death, and he traps Dong-yi trying to help the injured Gae Dwo-ra.
The king and the court realize Dong-yi's true past and identity. She is charged with being a traitor's daughter, hiding her identity, and helping a rebel group. The Southern Scholars petition to have her executed, but the king merely exiles her from the palace. Dong-yi's son, Prince Yungsu, died of smallpox, and she is banished from the court forever.
V. In exile
The King is heartbroken by his separation from Dong-yi. Despite being forbidden to do so, he goes to her residence and spends the night with her. She gives birth to her second child, Prince Geum (later King Yeongjo).
The six-year-old Prince Geum is bright and intelligent, but he longs to meet his father, the king. On an outing, the king recognizes Prince Geum as his son and befriends him, posing as an administrative officer.
Hui-bin learns about the king's secret meetings with Prince Geum and his lingering affection for Dong-yi. Her mother hires assassins to burn Dong-yi's residence in order to kill her and her son. The royal guards, who were instructed to watch over the residence, rescue both mother and son from the fire.
The king has been waiting to bring Dong-yi and her son to court. When Prince Geum turns seven, he is required to receive royal education. However, the king uses the failed assassination attempt on the pair's lives as a pretext to bring both into the palace early.
VI. Return to the palace
Many members of the court seek to promote Prince Geum to be the crown prince, replacing Hui-bin's son. Queen Inhyeon, who has no children of her own, adores Prince Geum and supports his claim. However, Queen Inheyon suddenly dies of an illness.
Rumors spread throughout the palace that Crown Prince Yun is infertile due to an undisclosed condition. If so, Prince Geum would be the natural alternative to be the king's heir. Hui-bin's supporters begin to abandon her and Crown Prince Yun in favor of Dong-yi and Prince Geum.
Desperate to retain her son's position, Hui-bin attempts to assassinate Dong-yi and Prince Geum. Dong-yi is injured, but Prince Geum is unharmed.
The king executes Hui-bin for using black magic to kill Queen Inhyeon, hiding Crown Prince Yun's infertility, and attempting to kill Dong-yi and Prince Geum. Before her execution, Hui-bin acknowledges her wrongs and begs Dong-yi to protect the Crown Prince.
The king offers for Dong-yi to become queen and Prince Geum to become the crown prince. However, Dong-yi refuses. She cites all the chaos Hui-bin has caused in court, and she asks the king to create a law preventing concubines from becoming queen in hopes that similar power struggles between concubines do not occur. The king agrees and appoints Queen Inwon as queen.
The king knows that Crown Prince Yun will always regard his half-brother Prince Geum as a threat. For both to survive, both must become kings. Because Crown Prince Yun is infertile, he will rule first after the king; Prince Geum will follow him. Because Prince Geum has a commoner mother, the king knows that the courtiers will not respect his position. He decides to abdicate so that Prince Yun would become king and Prince Geum will be cemented as the Crown Prince. However, Queen Inwon adopts Prince Geum, giving him royal protection and ensuring that he will follow Prince Yun to the throne after his death.
Dong-yi decides to leave the palace so that she can help the poor commoners.
VII. A new king
Dong-yi's son, under her tutelage, later becomes the 21st king of Joseon, Yeongjo, the father of Crown Prince Sado and grandfather of Yi San.