One Million Goblins and Three GM Roles
Let's say you have an encounter of One Million Goblins against a party of four in an elfgame of your choice. the party's The Wizard has an anti-goblin amulet that can eliminate 999999 of those goblins. The goblins proceed to ignore three-fourths of the heroes' party and stab that The Wizard as many times as goblinly possible before that amulet can be used.
This was the most tactically advantageous option for the goblins, that is, it was optimized to secure their win condition. This was the most in-character option for the goblins, that is, it accurately reflected their emotional response to the anti-goblin amulet. From both of these perspectives, the GM played the goblins correctly. However, our hypothetical The Wizard player does not appreciate this fine alignment of ludonarrative incentives. They're upset, because they feel like the GM decided their character was overpowered and singled them out to die. From their perspective, the GM has failed their most important role: making the game fun.
Traditional GM Roles
Here we have a few standard inherited expectations of what the GM is supposed to do: Playing the world, providing opposition, and keeping the table happy. Playing the world means bringing the NPCs, setting, etc. to life in a way that feels "real," or "makes sense," or perhaps "makes a good story." A GM who focuses on this might write up an outline of their campaign hub city's hidden troubles and what might happen if the players decide to ignore them. Or, they might make sure their main villain's motives and background provide some guidance for determining what actions of theirs are in-character during play. If you're purely focused on the experience of a shared imagined world, you might argue that this is the only role that matters. I'm not, so I don't.
Providing opposition for players to overcome is a role I most often associated with TTRPGs that are particularly combat-heavy or focused on resource management. If I'm GMing Lancer, it's my job to come up with robots that will shoot at my players' robots. My players are there because, among other things, they like the idea of being shot at. If I'm GMing a dungeon crawl, I may not create distinct grid-based combat encounters the same way, but I do want to present resistance, give the players reasons to push themselves and spend resources. If they didn't want that, they wouldn't be going into a dungeon in the first place. Overcoming opposition is not the appeal of every TTRPG! But it's an important aspect of enough very influential games that it contributes to this undercurrent of what we expect the GM to do.
Keeping the table happy is the responsibility I'm most ambivalent about, partially because I don't think it should be a GM's role exclusively. Everyone at the table should be trying to help everyone else have a good time, the GM shouldn't be uniquely obliged to perform and entertain, especially if the arrangement encourages them to sacrifice their own enjoyment for the sake of the players over and over. Furthermore, this is the traditional responsibility most likely to encourage you to ignore a game's imperatives or intended boundaries. Character death might be houseruled away, dice might get fudged to ensure a properly dramatic moment, and so on. This is a very popular approach, but, if correcting these rough patches is the automatically assumed responsibility of the GM, any disappointment in play can be characterized as a failure of the GM's duties, an outcome I am decidedly uncomfortable with.
Finding Another Way
Should these traditional GM roles come into conflict, they become very difficult to satisfy all at once. Fortunately, alternative paradigms are available. As demonstrated in the One Million Goblins example, it's very possible for "playing the world" and "playing to win" to encourage the same course of action, especially if you look into objective-focused tactical TTRPGs that set win conditions other than "kill the party." Some of my favorite statblocks for combat-focused games are those designed to express something about that character's personality. They're renowned for their courage, they deal the most damage when surrounded by enemies, so you'll see them charging into the fray. They care for their liege, they provide buffs that are particularly advantageous for them, so they'll support each other throughout the combat. There's no difference here between the "optimal" action and the "in-character" or "flavorful" or "role-play focused" action, the incentives of the character and the incentives of the statblock are the same!
The "keeper of fun" role is particularly vulnerable to clashing with the others, or even just becoming burdensome by itself. As mentioned before, my recommendation would be to distribute that responsibility to the whole table, but there is another key that can help: picking a game that encourages the outcome the group is looking for. Now it's not the GM's job alone, they have the system on their side to support them. The game can share that workload, and that means the game can share the blame when things go wrong! It's not shameful to discover that a system didn't play like you expected, or to admit that there's a mismatch between your table's preferences and the emergent incentives of the system. It happens. It's not solely the GM's job to "fix" that, it can just mean the game wasn't right for the group.
In that same vein, I've recently been drawn to systems that, without departing from the "one GM, many players" structure, take away some of the GM's traditional decision-making opportunities. In Fabula Ultima, the GM does not decide each turn of combat which player the NPC attacks. Instead, this is determined by a random targeting roll, or sometimes a prewritten routine. The GM forgoes any internal debate between attacking the fragile mage or the bulky knight, or trying to reason out whether the NPC would reasonably be aware of the players' rune of fire resistance. That all fades away with a roll of the dice. And if the mage is knocked out by an unlucky shot? The GM is just as surpised as anyone! When the GM turns that decision point over to the dice, they also lose the blame for how that decision turns out. I'm curious to see more "enemy AI" design from future games, and further examples of systems specifying what is typically left to the GM.
Looking Ahead
The traditional GM expectations I've outlined here often create competing demands on an unwary GM, but what I hope I've demonstrated here is that this is not a necessary condition of the role. Either through new game systems refining their design, or by a given table renegotiating the way they approach the game, the tensions between them can be lessened. I've found this realization very refreshing as a GM who prefers not to juggle too many factors at once, and it's something I'll keep in mind for my own experiments with game design in the future.