yeah, that's never really explained, in g1, and something that I never really thought of until now. Fortunately, I made my own theory on it, which is tied into my newest OC, over here: http://mlparena.com/index.php/topic,392815.0.html
Spoiler
About: Born into a poor social class, he was satisfied with basic necessities and thought that he had loving parents. However, when a decree came from the King for a sacrifice to appease “Lord” Tirek, who they believed to be a god for bringing calamity on their village for generations, the villagers coerced his parents into sacrificing him, due to them barely having the means to get by without the added burden of a child. The King offered a handsome sum to the parents- more than enough to survive on, if they went through with the task, and they did; convincing thew boy that there was no greater honor than to be sacrificed to appease the demands of the deities, though they were only interested in saving their own lives in the end.
On the night of the pink moon, before he was due to be sacrificed, Puremist made a wish on a moonbow to annihilate his entire race as retribution for their malice and selfishness. Tirek managed to overhear him and come to his aid, promising complete destruction upon formation of a pact that would would guarantee him power. In exchange for acquisition of the Moonbow/ rainbow of darkness, Tirek swore that he would have his wish fulfilled. Agitated and confused as to how he’d even manage to get the rainbow of darkness, he heatedly contested the terms of agreement. It was then that Tirek let him in on a secret that his race had not been made aware, that Queen Majesty the Unicorn of Dream Valley had most powerful spells at her disposal which were activated through song and that pony magic was what was needed in order to acquire the rainbow. Although Puremist believed Tirek was pulling his leg and just plain crazy, he sang anyway, providing a beautiful song that was laced with hatred and malice in every lyric. The moonbow reacted to the song’s magic and was guided into Tirek’s bag. With the deed done, Tirek fulfilled his end of the bargain and destroyed everyone- from King to commoner- in the village, while leaving him as the last of his race.
Do you guys have any theories of your own on how Tirek managed to get his hands on the Rainbow of Darkness?