The Triforce is said to grant the user any wish he/she desires, regardless of whether it is good or evil.
According to the Book of Mudora, the Triforce was created by the Goddesses following the Druthulidi conflicts in order to give life to the world and maintain beings that would fight the Druthulidi and uphold the laws and desires of the Goddesses.
After its creation, the Goddesses left Hyrule and entrusted the Triforce to the First Sages, awaiting for the Firstborn of the Goddesses so that it may be passed on to mortals. One of them, Sulkaris, became corrupt and attempted to steal the Triforce, but was thwarted by the other Sages and banished from the Sacred Realm forever.
When the Firstborn of the Goddesses awoke into Hyrule, the six loyal Sages and the three Oracles passed the Triforce unto them and placed it in their care.
In 4992 BG, the Druthulidi Vaati successfully convinced Zalunbar, the ruler of the Darknut Legion, to form an alliance against the Wind Tribe and covet the Triforce in their care. The Darknuts then initiated a crusade against the Wind Tribe, nearly destroying their race. On the brink of extinction, the Wind Tribe decided to ascend to the heavens with their powers and leave Hyrule forever. With the help of King Gustaf and the Ancient Hylians, Vaati and his armies of Darknuts were halted long enough for Siroc and the last of the Wind Tribe to escape. With the Wind Tribe gone, the Triforce was passed unto the Kingdom of Hyrule.
For many years, the Triforce is kept safe in Hyrule Castle, the capital of the Kingdom of Hyrule, under the throne of the King.
In 1 BG, the Moblin King Ganon kidnaps Princess Nylin Zelda I, the daughter of the current King Daphnes Nohansen Hyrule. In order to protect the Triforce, the King moves it from Hyrule Castle to the Water Temple under Lake Hylia and puts it in the care of the Zora guards.
The Princess is eventually forced to reveal the Triforce's location by the traitorous Sheikah Bongo's Eye of Truth, and with this information Ganon launches a full-blown assault on Hyrule Castle. Though the city ultimately falls, Ganon fails to obtain the Triforce - his final goal. Before King Nohansen dies, Bongo is able to extract from him the new location of the Triforce, but she decides to lie to him that it's in the Fire Temple on Death Mountain, since she realises that he'll contest with her when the artefact is found.
While Ganon is misled to Death Mountain and later killed by the Hylians when they assault his new fortress, Bongo and her followers rush to the Water Temple, but they did not expect Twinrova's Gerudo and Veran's Fairies, who also learnt of the Kingdom's fall and the Triforce's new location, to arrive and contest with them on the artefact.
When the three armies are busy fighting each other, the Zora Dominion is able to send a battalion to Lake Hylia to help defend the Triforce, and with the help of Zelda, Rauru, Impa and Demise, they are able to secure the Triforce before either Bongo, Twinrova or Veran would be able to snatch it. Having failed in their quest, all three armies surrender to the Zora.
First Golden Age
Shortly after the defeat of Ganon, the Sage of Light Rauru convinces Mediator Ooccoo that keeping the Triforce in Hyrule is too dangerous and that it should be returned to the Sacred Realm as it was in ancient times. Claiming that keeping the Triforce locked away from the world would lead to a decline, Rauru proposes to create a portal that could be opened to the Sacred Realm in times of need and suggests converting the Temple of Time in Hyrule Castle Town into such a door. The Oocca agree and work with Rauru in secret to transform the Temple of Time into a portal to the Sacred Realm. Once completed, Rauru and the Oocca build the Temple of Light inside the Sacred Realm and bring the Triforce to rest there.
In 100 AG, Vaati starts the Gerudo Wars in order to seek the Triforce for a second time, and for this goal he coaxes the Gerudo to declare war against the Kingdom of Hyrule. While the Gerudo successfully sacks Hyrule Castle Town, they are ordered by Vaati, Agahnim and Onan to immediately retreat so the Darknuts can occupy the city. Vaati and Agahnim search for the Triforce in Hyrule Castle Town, but both fail. Soon they are driven out of the city by Impa and the loyal Sheikah.