Obviously it assumes that your players are not actively malicious and derailing your plot for derailment's own sake, because if that's a case you have problems aside from your ability to run the game.
More to the point, it works on all levels, from "your players have decided they want to be bandits instead of saving the kingdom" to "your players, upon hearing about Ganon's evil reign, have begun organizing a rebel army instead of chasing down magic swords." If you just tell them what to do, then it's no fun for them because they just feel like characters in your novel, but if you don't tell them what to do they're bound to make a wrong turn at some point. That's why, rather than let them organize their army and storm Ganon's tower and oops normal swords can't slay him I guess it's 10,000 years of darkness good job not reading my mind, you quietly re-arrange events in the background. You still make them go get the magic sword, but instead it's under the guise of "The Gorons will only help if you complete this sacred trial" and "the Zoros will lend their support if you help them get this magic thing" and "if you get this magic sword from ancient legend it's sure to rally more people to your cause." You still have the big final battle, but instead there's a war raging around them. Nothing has actually changed, but your players don't know that.