Malak and his mentor and best friend, Revan, were Jedi that were connected with the Order's enclave on Dantooine. While they were there, they discovered a Star Map that had been left on the planet by the Rakata, a species that had ruled the galaxy in the distant past.
When the Mandalorian Wars began and Outer Rim planets began to fall, Revan defied the Jedi Council and insisted on defending the galaxy alongside the Old Republic starfleet. The first to follow him was Malak, against the wishes of his own master. Together they rallied many young Jedi and began destroying the Mandalorians in battle after battle, finally defeating the mercenary leader, Mandalore the Ultimate, above Malachor V, a long forgotten Sith world. The duo took their fleet, however, and passed beyond known space, insisting that they had to destroy the remnants of the Mandalorian armada. While beyond the Rim, they found the Star Forge, an ancient marvel of Rakatan engineering. Corrupted by the dark side energies present on Malachor and the power by the Star Maps and Star Forge, Malak and Revan fell to the dark side and founded a new Sith Empire out of the Jedi and Republic forces who still followed them. Revan then became Darth Revan, Dark Lord of the Sith. However, it is hinted in the sequel that the Revan was not, in fact, corrupted, but chose the dark side merely to conquer, and ultimately strengthen the Republic against some unknown threat.
While Malak served Revan loyally for a time, eventually, he began to chafe under Revan's command and sought to claim the title of Dark Lord for himself. The moment came when a Republic strike team, led by Jedi Sentinel Bastilla Shan, staged an assault on Revan's flagship. Malak wanting to seize the command of the Sith Empire, at last had the perfect plan to do it. He opened fire towards the command deck of Revan's Flagship knocking out Revan and giving the Jedi the chance to take him back to Dantooine and basically rewire his mind with the force. While Malak believed that he had taken his old mentor's place as the Dark Lord of the Sith.
While the war against the Republic was going very well, he feared Bastilla's gift of Battle Meditation, a rare Force power that enabled her to strengthen the Republic forces' resolve and coordinate their fighting effort while sapping the will of their enemies, making her a threat to the entire Sith war effort. Malak expended tremendous resources in an attempt to locate her.
Malak nearly succeeded once when he blockaded the planet Taris. Although he had the planet destroyed to prevent Bastilla's escape, she nonetheless was able to return unharmed to Dantooine accompanied by her rescuers. Among these heroes were two citizens of Taris, Mission Vao and Zaalbar; Republic pilot Carth Onasi; the utility droid T3-M4; Canderous Ordo; and Revan himself, his mind reprogrammed as a crew member from the Republic cruiser Endar Spire.
Bastilla and her companions left Dantooine in search of the source of Malak's power. While on their search, Bastilla was captured by Malak. Malak corrupted Bastilla to the dark side of the Force and made her his apprentice. (Malak's previous apprentice, Darth Bandon, had recently been killed in action by Revan.)
It is not surprising that Malak's fate would be connected with Bastilla's. The two were very much alike -- courageous, arrogant, and heedless of the warnings of their Jedi instructors to beware the call of the dark side. But the true reason Malak chose Bastilla for his apprentice was the unimaginable advantages the Sith Empire could gain from her Battle Meditation. Among the Sith, there is no such thing as camaraderie.
The source of this power was the subject of the Star Map that Malak and Revan had discovered on Dantooine long ago: the Star Forge. The Star Forge was an enormous space station and battle dreadnaught constructed by the Infinite Empire of the Rakata. The Rakata were a technologically advanced but savage species who extended their power throughout the galaxy by means of conquest. The Star Forge was constructed above one of the poles of their home star. There, the Star Forge fed on the star's energetic hydrogen and the dark side of the Force to produce an unending supply of starfighters, capital ships, and war droids for the Rakata prior to their collapse, and now for the Sith.
The heroes on the quest for the Star Forge called in the Republic fleet to attack the Sith. For a while, it looked as if Malak would be able to destroy his foes in a single, glorious day. Fate – or the Force – handed Malak a stunning defeat, however, and it would be he who would die when his former master; and old friend, Revan, returned. During the battle, his old master boarded the giant machine in the Ebon Hawk, defeated an attack force of Forge droids, slew nearly the entire pool of Malak's Dark Jedi and Sith apprentices, redeemed Bastilla, and finally killed his old friend in single combat.
Malak tried to blame Revan for his fate, but then admitted that, in the end, the only person he had to blame was himself. Humbled by that knowledge, still bested by Revan despite all his clever plans and conquests, Malak, realizing that nothing he had ever done or could ever do could compare to the things done by his former master, at last acknowledged his inferiority, and his final words were the truest he had ever spoken: "And in the end, as the darkness takes me, I am nothing." Then Malak dies and Revan saves the Republic.