Let’s start with a brief summary of what comes before. At the end of Season 2, and for reasons best left to a different explanation article, the Doctor (David Tennant) is forced to leave his love Rose Tyler (Billie Piper) in a parallel universe with a human copy of himself. The bulk of Season 3 follows the Doctor and his travels with Martha Jones (Freema Agyeman), a medical student who helps him save a hospital that is teleported to the moon by cranky, rhinoceros people. Martha, like most of the new companions, falls instantly and deeply in love with the Doctor, who doesn’t reciprocate in the slightest. He basically tells Martha that she’s a rebound companion, which only makes her more desperate to win his affection. She proves herself over and over on their travels, but he never gives her anything more substantial, not even to cement a solid friendship.
The three-part finale of Season 3 sees the Doctor and Martha running into Captain Jack (John Barrowman) when he accidentally crashes the TARDIS into the end of the universe. The trio then meets Yana (Derek Jacobi), an elderly man helping the dying remnants of humanity escape into the stars. But meeting the Doctor unearths hidden memories in Yana, who rediscovers that he is the Master, a Time Lord who previously opposed the Doctor many years ago (before the 2005 BBC reboot). With his mind partially intact — he’s never fully sane, not really — the Master steals the TARDIS, regenerates into a new, younger form, then leaves the Doctor, Martha, and Jack stranded at the end of the universe. Fortunately, Jack has a Vortex Manipulator (read: handy plot device) that returns them home, which is now the Master’s home too.