Backstory of Twilight Princess -- Ganondorf and the Twili ***SPOILERS***
Long ago, the goddesses created the world, as well as the Sacred Realm. "For ages," she says, "the people lived at ease, content in mind and body." But rumors of the Sacred Realm soon spread through Hyrule, and a great battle erupted in response to these rumors. A group of "interlopers who excelled at magic" attempted to establish dominion over the Sacred Realm with their mighty powers. The goddesses, however, ordered three light spirits to seal away this magic--the Fused Shadows--that these interlopers used to control the Realm.
These invaders were the greatest criminals that Hyrule had ever known, and the goddesses themselves, they say, soon tracked them down. Some of them were brought to Gerudo Desert and sentenced to death. But their sentence was much worse--they were sent directly to the underworld by a powerful cursed mirror. That place became known as the Twilight Realm by its inhabitants. The mirror was called the Mirror of Twilight, and it was guarded by the ancient sages.
The leader of the interlopers (referred to also as a "band of thieves") was a man named Ganondorf, reknowned as the demon thief. Fortunately, his treachery was brought to a halt, and he was brought to Hyrule to stand trial (presumably after Adult
OoT). His death sentence was carried out by the sages themselves, but something none of them expected happened. Ganondorf's Triforce piece, the Triforce of Power, helped him to escape death, and he broke free of his bonds and attacked the sages, killing one of them.
In desperation, the other sages activated the Mirror of Twilight, banishing Ganondorf to the Twilight Realm, before he could finish them off.
EDIT: Edited for clarification. [See bolded.]