A couple forum threads, G+ posts, and blog posts have been discussing this quote: "The GM’s job is to be defeated by the players in the most entertaining way for everyone involved." I've lost track of which blogger originally said this, and I'm not going to track down all the various discussions about it, because I'm sure everyone's seen them by now. But in a couple places, I posted my response, without any explanation of my meaning: "The GM's job is to give the players enough rope to hang themselves with."
Now, I want to note that I don't say it's the GM's job to hang the players, or to cause them to hang themselves (or their PCs.) Nor is hanging even a desired outcome. Nor is it the GM's job to prevent a real or proverbial noose in the game from being used in any way except a hanging. The GM's job is not to force a specific outcome, in other words. I've said before that the GM and the rules of any given RPG, are there to make stuff happen... but it doesn't matter what that stuff is, as long as some kind of stuff is happening.
When people discuss using rumors of a dragon in a remote mountainous location in a true sandbox, with no scaling of challenges to PC level, the implication is that 1st level PCs could hear these rumors and choose to investigate -- and probably be killed. But what if they aren't killed? What if they somehow gain control of the dragon? Maybe sneaking up on it while it sleeps, then all simultaneously jumping on its back, striking to subdue? Suddenly, those 1st level PCs have a lot of treasure and a significant increase in power because they control a dragon. That dragon could have killed them; the players (hopefully) knew it could kill them. They took the risk, and turned the situation around. All the GM does, or should do, is provide the information that's available about the dragon, play the dragon when the time comes, and judge the effectiveness of any plan the players come up with. It's not the GM's job to kill the players through the agency of the dragon, nor is it the GM's job to protect the PCs, or protect the dragon for future use in a plot, or to shoot down any ideas the players come up with until they find the one scheme the GM had in mind when designing the encounter.
The GM creates things and situations with potential results, but does not play favorites with those results.
The same actually applies to non-sandbox playstyles as well. If you were playing a high-improv, narrative control game like InSpectres (medieval monster hunting franchise, maybe?) the GM's job is to set up situations for the players to deal with, then interpret any failed rolls as complications. In that game, the GM doesn't even get to decide if the player plan works; the success dice earned during the "investigation" and the individual dice rolls determine that. The GM does not play favorites, overruling the dice.
If you were playing a pre-determined "plot" style, the GM's job is to come up with the plot beforehand and to look out for bottlenecks or deadends, but it is not the GM's job to protect certain imagined results. The more mandatory cut scenes you have, the more railroad-y the game will feel; a good pre-determined plot GM will accommodate unexpected player choices and try to work the results into something that maintains the general plot without overriding player agency. The GM does not play favorites, protecting the precious pre-designed events.
What the GM must do is: give the players things to interact with, either as sandbox elements, improvised elements, or plot points, and then play out those interactions. What the GM should hope for is: entertaining results that emerge unexpectedly from those interactions.