Following the fall of the Jedi Order at the end of the Clone Wars, Jedi Master A'Sharad Hett returned to his home planet of Tatooine, where he took command of an army of Tusken Raiders before being defeated by fellow Jedi-in-exile Obi-Wan Kenobi. Exiled from his home, Hett eventually arrived on the Sith world of Korriban and discovered the holocron of XoXaan, one of the original Dark Lords of the Sith, and chose to learn the ways of the Sith from it. Hett eventually emerged to find the Galactic Empire had fallen due to the efforts of Luke Skywalker and the Alliance to Restore the Republic, leaving him unable to take revenge against the Sith Lords who destroyed the Jedi: Darth Vader and Darth Sidious. Feeling robbed, Hett fled to the Unknown Regions, only to be captured by a race of extra-galactic beings known as the Yuuzhan Vong. Upon capture, Hett was brutally tortured, experimented on and imprisoned in a torture device known as the Embrace of Pain. There, he encountered Vergere, a Jedi from before the Clone Wars who secretly trained as a Sith under Darth Sidious. There, the two discussed the future of the Sith Order, with Hett believing that an army of Sith would be best to bring order to the galaxy while Vergere preferred to follow Darth Bane's Rule of Two. Unable to agree and deciding he was a lost cause, Vergere left Hett to the Yuuzhan Vong as she went to assist in preparation for their attack on the galaxy.
Alone, Hett waited until he was strong enough in the dark side of the Force to escape his torment. During the process, the former Jedi attacked his captors with Force lightning and stole a Yorik-et starfighter to flee the ship. In order to keep his survival a secret, Hett destroyed the scout ship, killing everyone on board before retreating back to Korriban. There, he took on the name Darth Krayt, after the reptilian predators from his homeworld. Finishing his training, he founded a new generation of Sith, the One Sith, while the New Republic was distracted by the Yuuzhan Vong and their invasion. Over time, he and his followers continued to build up strength before emerging and taking over the galaxy, with Krayt becoming Emperor of a reborn Galactic Empire. He would later tell Cade Skywalker of his escape while torturing him in an Embrace of Pain over a century later.