It is confusing to many Link players the reason there is a timeline where the Hero of Time is defeated during Ocarina of Zelda events.
The confusion behind Zelda's timeline split
The fact that there is a timeline split where Link really has been killed by Ganon is provided to us beyond any shadow of a doubt within the Hyrule Historia, an official Nintendo book containing the truth about how events unfolded.
While many have questioned, "if Link dying to Ganon or anywhere else during the adventure results in a timeline split, then why doesn't that happen at any other time in the series? Why is there only one split?", noone has put it simply.
The timeline split explained
So, the truth is: the events that lead to the "Hero is Defeated" split is not presented to us within the Legend of Zelda: Ocarina of Time game. We only get to experience The Hero is Trumphiant split, which leads to both the Child and Adult era.
However, since the "Hero is Defeated" split exists simply when Link is defeated, it is probably safe to say that the Ocarina of Time story unfolds normally but Ganondorf wins during the last showdown.
Ganondorf reigns supreme
"Ganondorf the thief obtained the Triforce of Power and managed to get his hands on Princess Zelda. The Hero of Time, Link, challenged him in a battle that would determine Hyrule's very existence, and lost." (Hyrule Historia (Dark Horse Books) pg. 92)
As players, we don't get to see a "bad ending" ourselves, but it is easy to understand what happens from that point into A Link To The Past's lore.