Here's why The Doctor found herself on the wrong side of Judoon law in Doctor Who's season 12 finale episode. "The Timeless Children" was a game-changing moment for Doctor Who, revealing the true nature of the Timeless Child. As explained by Sacha Dhawan's Master in an extended sequence set within the Time Lord Matrix, The Doctor came through a portal from another universe and was adopted by a Gallifreyan, who would then copy the child's natural powers of regeneration for her own people. In a further revelation, The Doctor had experienced an unknown amount of lives prior to the William Hartnell incarnation, and was employed by the mysterious Division before being memory-wiped.

This mammoth piece of lore tied into the mystery of the Ruth Doctor that began in earlier season 12 offering, "Fugitive of the Judoon." In that episode, The Division sent a platoon of Judoon to 21st century Earth to find a former employee gone rogue. Although Whittaker's Doctor suspected Lee was the wanted man, he were merely the partner of the real runaway, Ruth. In a shocking twist, Doctor Who revealed that Ruth was actually The Doctor, and had wiped her identity with a Time Lord Chameleon Arch to remain hidden. Even stranger, neither Ruth, nor the Thirteenth Doctor, recognized the other as a past regeneration. In "The Timeless Children," The Doctor figured that Ruth must've been one of her many pre-Hartnell incarnations.

Related: Doctor Who's Timeless Child Twist Creates A Major Villain Problem For All Future Seasons

However, the final scene of Doctor Who season 12 sees Whittaker captured by Judoon and locked up in an asteroid prison. The reason for this harks back to "Fugitive of the Judoon," where the space rhinos were hunting down Ruth. Although she was strongly advised not to, the Thirteenth Doctor told both Commander Gat and the various Judoon present that she was also The Doctor. Even though Gat was killed during the confrontation, the scene establishes that she's merely working at the behest of a mysterious superior, so her death doesn't mean the Judoon's pursuit of The Doctor will cease, especially now that a second version of the fugitive has been identified.

Doctor Who Shada Timeless Children Prison Comparison

A few other details in The Doctor's arrest confirm that her escape from The Division long ago is the charge against her. First of all, the Judoon break into The Doctor's TARDIS - something they almost certainly wouldn't have been able to manage without direct assistance from the Time Lords. Secondly, the Judoon claim to be part of a "Cold Case Unit." This makes sense, as so long has passed since The Doctor was Ruth, the investigation likely went cold until the Thirteenth Doctor directly intervened in "Fugitive of the Judoon." The arresting officer also specifically uses the word "fugitive," linking back to their appearance earlier in the season.

Lastly, and most fascinating for fans of classic Doctor Who, the exterior of the prison The Doctor finds herself in at the end of Doctor Who season 12 appears to be the same facility seen in the originally unaired Tom Baker episode, "Shada."  In this adventure, Shada is a Time Lord prison facility kept in its own bubble universe for maximum security. Since it's The Division working with the Judoon to hunt The Doctor down, it naturally follows that her life imprisonment sentence would be carried out in a Gallifreyan jail.

While the cause of The Doctor's incarceration can be figured out, it remains to be seen how Jodie Whittaker will escape in the upcoming "Revolution of the Daleks," especially if the prison is confirmed to be Shada. Although the prison ending was certainly a shock to viewers, it may be good news for those desperate for clarification about the Timeless Child. If The Doctor's escape from The Division is what led to her arrest, she'll no doubt be forced to face her past sooner rather than later.

More: Doctor Who: Every Plot Hole Created By Ridiculous Timeless Child Reveal

Doctor Who continues with "Revolution of the Daleks" this holiday season on BBC and BBC America.