This is all decided by the GM. With full knowledge of the players' capabilities and their character abilities and location and destination and everything else.
Some of us good DMs don't make every encounter an anti character one.
In 5e, that is likely not going to be the case unless the DM decides to share all the decisions he made that led to this point and why he made them.
Logically, the player would not know every detail of the game and game play. It's not like an RPG player is like a viewer or video gamer and gets a special cut screen to explain everything.
You want to take away GM ability to make decisions, so that they cannot make bad decisions (either by accident or by purpose.) But at the same time you're taking away the GM ability to make good decisions, that enhance the play. You seem to see GM contribution as some sort of necessary evil that we need to minimised, whereas I see it as one of the biggest strengths tabletop RPGs have over computer games.
Hear, hear! Because a DM might make a bad call or decision or such.....you like games that limit them to only one or very few things.
But not all GM inventions are such contrivances. If the capability and nature of the enemies or the layout of the location were independently (and hopefully previously) established then it is not a contrivance; they are not created as a response to the player action declaration for the express purpose of nullifying it.
I'd just note here the players will often not know things.
I just do not accept that there is some kind of objective rational GMing techniques. Well, there is, but the grounds of that, it's motives and principles rest in the social dynamics of play, not in some kind of rational calculations of fictional reality.
Techniques? I guess I could write out a bunch of them. Though this has a lot of problems.
Most people....like 75%...are really stuck in what they can "imagine" or "think of", and it only get worse. Back in the 20th century there was at least a lot of diversity of thought. In the 21st century nearly everything is just more of the same over and over and over again.
The how is the thing here. If a GM is deciding you suddenly face an Ogre Because he is trying to kill the party, versus you suddenly face an ogre because thirty minutes ago the PCs killed that ogres brother, those are two entirely different things
Except this is pointless. This is just sneak legalese.
Sure players say it is "bad" if the DM is "trying to kill the PCs and just has a Ogre attack".
But as long as the players know "why" or have a "good idea why" or "approve" of the reason for the Ogre attack, then it is "Okay!"
But the players won't always know everything...and they can't as that would ruin the story. The players are not viewers sitting at home watching a TV show or pushing buttons on a video game: they have active "live" characters in a simulated game world.
You can't stop the game every hour or so and give the players "cut scenes" so they fully understand every single detail of the story.
Hang on. You're saying that if you decide the one thing that will happen, it's an Unlimited Game of infinite possibility, but if hawkeye decides six things that could happen and rolls a d6 to determine which one it is, it's a Limited Game (TM). Isn't that the wrong way round? Doesn't his game have six possibilities while yours has one?
Maybe you missed a post?
So, with my infinite limitless creative I can think of a large, large number of possibilities. I have no limit at all. And I will pick one.
In the Limited Low Creativity Game, the rules or the DM have a tiny list of things that are possible. And a roll determines one of those few, and the DM can add some fluff.
It is Anything vs every dumb video game with NPC that have five random greetings each time you 'talk' to one...and they cycle through them and repeat and repeat and repeat.