Prior to the events of Jedi Knight
Yun was born into an extremely wealthy family, his father being a wealthy baron who owned a very successful mineral mining business. The pampered heir's brash impatience made his father wary of passing on the family business to him, and he sent him away to learn discipline from a group of monks on the planet of Bunduki. The monks refused to teach him, however, and he was sent home, further disappointing his father.
Yun began to spend more and more time with his father's fiancée, a woman named Sariss who was a Prophetess of the Church of the Dark Side. As he became further and further immersed in her teachings, and as Sariss taught him how to command the Dark Side of the Force, Yun fell in love with her.
Sariss tells him that she also loves him but that they cannot be together because she is already pledged to his father. Filled with jealous rage, Yun slew his own father and left with Sariss, who brought him before her Dark Jedi master Jerec, who accepted him as one of his six apprentices.
As time passed, Yun became a callous killer, taking life without remorse at Jerec's command. He noticed, though, that Sariss would no longer respond to his feelings and began to experience horrific nightmares of his murders. Perhaps suspecting that Sariss had tricked him, or perhaps finally experiencing guilt for his killings (or perhaps both), Yun began to doubt his choice to join the Dark Jedi and regret his many murders.
Nevertheless, at Sariss's encouragement, he returned to the monks of Bunduki who had sent him away and slaughtered them all.
When Emperor Palpatine died along with the second Death Star, Jerec formed a plan to reform the Empire with himself as Emperor. To do so, he decided to search for the Valley of the Jedi, an ancient battleground that housed the Force power of thousands of dead Jedi. If Jerec could take this power, he would be virtually unstoppable.
Yun accompanied Jerec in his quest, aiding him in the capture of the Jedi Qu Rahn, who had knowledge of the Valley of the Jedi's location. Rahn refused to give the Dark Jedi any information, attempting to goad Jerec into killing him. Instead, Jerec used the Force to probe the Jedi's mind, discovering that it was Rahn's friend, Morgan Katarn (whom Jerec had already killed), that knew the Valley's location. Fortunately, however, Jerec had in his possession Morgan Katarn's data disk, which held the secret to the Valley's location.
Realizing that his secret had been discovered, Rahn used the Force to steal Yun's lightsaber, and fighting back each of the six Dark Jedi in Jerec's service, even managing to bisect the former Jedi Maw with the stolen weapon. Jerec, however, proved too much for Rahn. Using the Force to subdue Rahn's mind, Jerec executed the helpless Jedi.
During the events of Jedi Knight
Yun was then tasked with aiding 8t88, a droid information broker who was attempting to decoded Morgan Katarn's data disk. This mission set him up against Kyle Katarn (whom the player plays as), Morgan's vengeful son, who also sought the Valley's location. Yun is the first boss encountered in the game.
His use of Force Blind and Force Persuasion (which renders him invisible to the player, unless you use Force Seeing) can make him an annoying enemy, but he should not pose too much of a challenge.
After being bested by Kyle Katarn, Yun asks Kyle if he will kill him. Kyle deactivates his lightsaber and lets Yun live. Yun then recovers his lightsaber and uses the Force to levitate through a hole in the roof to escape. Yun was impressed with Kyle's mercy, and his doubt of the rightness of his decisions increased further.
Although it is not seen in-game, the Jedi Knight books reveal that Yun is then visited by the ghost of Qu Rahn, who told him that the fate of billions hinged on his actions. If Yun continued to help Jerec, countless people would die and many more would suffer under his rule. Rahn's continued counsel eventually convinced him to turn away from his evil ways.
Later in the game, Yun and the other Dark Jedi see the end of Kyle and Maw's duel. Filled with anger at Maw's goading, Kyle kills the Dark Jedi in cold blood. Jerec tries to convince Kyle to then give in to the Dark Side and kill Jan Ors, his old friend and lover.
At this point, depending on whether your alignment meter, Kyle will either kill Jan and attack Jerec (Dark Side) or deactivate his lightsaber, refusing to give in to his anger (Light Side). Regardless of Kyle's decision, Jerec will then use the Force to blast Kyle onto the ship they had been dueling beside and then send the ship down toward the planet's surface.
Obviously, the Light Side decision is the outcome that is considered to be the right choice as far as the story goes.
Kyle is later captured by Sariss, Boc (another of the Dark Jedi), and Yun, bound helplessly before them. Boc smashes Kyle's lightsaber with a rock and leaves Sariss and Yun to finish off Kyle. Now again, depending on whether you have chosen the light side or the dark side, one of two things will happen.
If you have chosen the Light Side, Sariss moves to strike down the defenseless Jedi, but Yun selflessly throws himself in the way of her attack, saving Kyle's life. When Sariss questions his sacrifice, he tells her that Kyle deserved a fair fight. Honoring his final wish, Sariss releases Kyle, who takes up Yun's lightsaber, and the two duel to the death, with Kyle being the victor. Yun's primary role is his sacrifice, which allows Kyle to continue his quest and eventually defeat Jerec. This is considered the canon storyline of the game.
Alternatively, if you have chosen the Dark Side, Yun himself releases you and duels you, He is much more difficult in this battle than before and uses the Force throw objects around the battleground at you, which can be a pain to deal with. After you win the battle, Yun is killed and Sariss forsakes Jerec in favor of joining Kyle.