Karlax was a Time Lord Cardinal on the High Council during the Last Great Time War. He had a history with the Doctor and hated him because of their experiences together. While the Doctor returned the contempt, he genuinely didn't care much about Karlax, though he would react with anger if Karlax pushed him too far.
When the War Doctor arrived on Gallifrey to show Rassilon and the High Council of a new Dalek plot to wipe Gallifrey from history, a guard sent by the Castellan brought Karlax to the landing site of the Doctor’s TARDIS.
When the Doctor escaped his imprisonment on Gallifrey, Karlax pursued him with some help from the Celestial Intervention Agency, taking command of a Battle TARDIS. When the CIA and their Battle TARDISes were attacked by Dalek stealth ships, the Doctor materialised around Karlax and saved him from death, though he still had to regenerate. The Doctor and Cinder took Karlax to the TARDIS' Zero Room where he could recover.
After regenerating, Karlax regained consciousness and attempted to take the Doctor's TARDIS back to Gallifrey. The Doctor planned for Karlax's deception and set the TARDIS controls to make it dematerialise around the Doctor if Karlax tried to pilot it. Realising he had been tricked, Karlax tried to kill the Doctor, but Cinder pushed him out of the way and took the shot. Outraged by his actions, the Doctor dematerialised his TARDIS, setting the controls so that Karlax would be left behind in the middle of the Dalek Eternity Circle, who swiftly gunned him down. (PROSE: Engines of War)