Hyrulean Civil War

The Hyrulean Civil War or Unifying War are fanon names to refer to the war that occurred prior to the events of Ocarina of Time. Little is known about this conflict; such as who began the fighting, why it started or how long it lasted. What is known is that it eventually resulted in the unification of Hyrule under one banner and that it occurred shortly before the outbreak of (what is thought to be) the Imprisoning War. It orphaned the child that would grow up to become the Hero of Time and left him under the guardianship of the Great Deku Tree. It can be surmised from Link's estimated age at the beginning of Ocarina of Time that it occurred roughly ten years prior to the events of the game, as Link was said to be a baby during the conflict.

Civil War Theory
One possible theory regarding the nature of this particular conflict is described below. The first paragraph explains a few claims the theory makes, so that the actual theory, written in the second paragraph, can be understood easier.

One element of the theory is that it is possible that Ganondorf aided the King of Hyrule during the Hyrulean Civil War. This could be concluded from the King's trust in him at the beginning of Ocarina of Time, who chose to not even believe his own daughter when she told him she didn't trust Ganondorf. Another element is that the opening cutscene of A Link to the Past suggests that a civil war might have been going on in Hyrule over the Triforce at some point in Hyrule's distant past, and seeing as this war lead almost directly to "evil power flowing from the Golden Land," it may be that this particular conflict it was describing was the Hyrulean Civil War that took place shortly before Ganondorf's imprisonment in the Dark World. It was noted that the Triforce had become a desirable object amongst Hyrule's tribes in A Link to the Past, and that somehow the fierce fighting broke out amongst them over it, meaning that at some point one of the tribes might have threatened to seize it for their own. In Twilight Princess, gamers learn that the ancestors of the Twili, tried to do just that, and as such, their actions might have been what triggered the civil war.

The theory goes that roughly ten years before the events of Ocarina of Time, a group of "Dark Interlopers" attempted to use their dark magic to seize control of the Sacred Realm and the Triforce that was held within it. Upon learning that one "tribe" was trying to take the Triforce for themselves, the other tribes of the land of Hyrule began to quarrel and fight, as depicted in the opening sequence of A Link to the Past, leading to a massive civil war that engulfed the entire land. The three Goddesses sent the Light Spirits to drive the Dark Interlopers into a realm known as the Twilight Realm. They also sealed away the Fused Shadows within the Forest Temple, the Goron Mines, and the Lakebed Temple (possibly known by different names at the time). As the civil war raged across Hyrule, the king of the Gerudo, Ganondorf, came to help the King of Hyrule unify the land and to quell the destructive war that was tearing the land apart. As a result, the Hylians were able to end the war with Ganondorf's help, and Ganondorf won the King's trust. It was due to this war that Ganondorf learned of the sacred Triforce and the power it represented, which he would covet not so long afterward in another even greater war known to legend as the Imprisoning War. During the course of the war, a Hylian mother tried to escape the fighting with her infant son, but was gravely injured in the process. As she fled to the Kokiri Forest, her time grew short, and her only choice was to entrust the child to the Great Deku Tree, the guardian spirit of the forest. The Deku Tree could sense this was a child of destiny, whose fate would affect the entire world. After the mother passed away, the child was raised as a Kokiri, completely unaware of his lineage as a Hylian and descendant of the Knights of Hyrule or of his destiny as the Hero of Time that would come to pass in due time when Ganondorf returned to Hyrule a decade later.