A few years later the King of Hyrule, in an attempt to end the bloodshed and chaos of the fierce wars, began to unify the people of Hyrule. He became Sworn Brothers with Darunia, the "big boss" of the Gorons. In an alliance with King Zora, the Zoras served the King of Hyrule by protecting Zora's Fountain, the source of all the water in the Kingdom of Hyrule. The King of Hyrule then turned his eyes on the Gerudo thieves.
Every hundred years a male Gerudo is born, and becomes King of the Gerudo thieves. Ganondorf Dragmire, leader of the Gerudos, had an all-consuming lust for power that he hid from the King of Hyrule. As Ganondorf swore allegiance to the King, he secretly schemed to obtain the Triforce and rule the world.
The Royal Family itself was keeping important information secret. According to Hylian legend, the Temple of Time in Hyrule Castle town was the entrance to the Sacred Realm. And why would the Door of Time be guarded so intricately unless something important was hidden behind it? And what was meant by this inscription on the altar?
Ye who owns 3 Spiritual Stone
Stand with the Ocarina of Time
And play the Song of Time
Ganondorf schemed to obtain the three Spiritual Stones, and kept his eyes and ears open for any clues about the location of the Ocarina of Time. He soon heard about the composer brothers of Kakariko, Sharp the Elder and Flat the Younger, excellent musicians who had been assigned to study the hereditary mystic powers of the Royal Family. One researched the song to control the sun, and one researched the song to control the moon. They completed their study and found out that both songs were one and the same, and that this song could control time.
Ganondorf thought that this song might be the Song of Time, one of the keys to the Sacred Realm, and attempted to steal their results. The composer brothers destroyed their research, and inscribed the song in the Royal Family's tomb. When Ganondorf arrived, they refused to tell him anything, and were sent to the grave with their secret.
Ganondorf continued his schemes, contriving to steal the Spiritual Stones from their owners. Reviving the dinosaur-like Dodongos that once populated the Gorons' Dodongo Cavern on Death Mountain, Ganondorf effectively blocked off the Gorons' food source. He promised to remove a huge boulder that blocked the entrance to the Cavern if the Gorons would give him the Goron's Ruby, the Spiritual Stone of Fire.
The King of the Gerudos discovered that one the duties of Princess Ruto of the Zoras was feeding the Zoran patron deity, Lord Jabu-Jabu. Ganondorf put a sickness curse on the oversized fish so it could not tell the difference between food and feeder. Planting a fake note from Ruto in a bottle in Lake Hylia, he planned to let the Zoras attempt to rescue her, and fail, until they turned to Ganondorf for help and awarded him the Zora's Sapphire, the Spiritual Stone of Water.
Ganondorf entered the forbidden forest and tried to get the Kokiri's Emerald, the Spiritual Stone of the Forest, directly from the Great Deku Tree. When the Kokiri's guardian spirit refused to hand it over, Ganondorf, in a rage, put a death curse on him which sapped his power. With his final hour approaching, the Deku Tree called Navi, a forest fairy, to him and commanded her to bring Link, the boy of destiny.