This has absolutely changed over time in D&D. The balance between Dungeon Master discretion versus reign of the rules versus player empowerment has always been debated in D&D circles but there's a clear evolution of thinking across the span of versions. The attitude towards rulings vs. rules in the game shows up
- directly and explicitly in the rules text
- implicitly in the text and detectable via textual analysis
- in the surrounding publications considered semi-canonical (Dragon magazine, nowadays forums and designer blogs), and
- the culture of gamers surrounding it.
Let's stick mostly to the first two in the interest of space.
Dungeons & Dragons 0e
In the origins of the game, Chainmail, there was no concept of straying from the rules - it was a wargame. You could (and often did) mod the rules prior to play, but the whole thing about wargaming is that, like board gaming, the rules are considered inviolate during an instance of play as a core assumption. Some wargames didn't have a "referee" role, and those that did, the role was very much like a sports referee - to determine if some violation of the rules had occurred.
But in the very first version of Dungeons & Dragons, Gary Gygax and Dave Arneson open the OD&D "Men & Magic" book with this admonishment to the "referee":
These rules are as complete as possible within the limitations imposed by the
space of three booklets. That is, they cover the major aspects of fantasy campaigns
but still remain flexible. As with any other set of miniatures rules they are
guidelines to follow in designing your own fantastic-medieval campaign. They
provide the framework around which you will build a game of simplicity or tremendous
complexity — your time and imagination are about the only limiting
factors, and the fact that you have purchased these rules tends to indicate that
there is no lack of imagination — the fascination of the game will tend to make
participants find more and more time. We advise, however, that a campaign be
begun slowly, following the steps outlined herein, so as to avoid becoming too
bogged down with unfamiliar details at first. That way your campaign will build
naturally, at the pace best suited to the referee and players, smoothing the way
for all concerned. New details can be added and old "laws" altered so as to provide
continually new and different situations. In addition, the players themselves
will interact in such a way as to make the campaign variable and unique, and this
is quite desirable. - Gary Gygax and Dave Arneson, Dungeons & Dragons Volume 1, Men & Magic (1974), p.4
This is supported by textual analysis as well - the game rules' intent (medieval people having adventures!) versus the relative paucity of the rules basically required large degrees of interpolation and discretion just to run a game. The gap between the mode of play and the written rules is so wide that reading the rules as an all-encompassing legal text on how to play is infeasible. Still, the metaphor is of the referee changing the rules as you proceed, with little discussion about ad hoc rulings.
Later supplements continued this theme. In "Swords & Spells," the mass combat add-on, they note:
The second thing to remember is that these rules deal with fantasy. If something is unclear as to how or why it works that way, remember that it is all fantasy. Fantasy is not bound to rigid rules and rationales. Fantasy is imaginative. If you feel that your fantasy is better that this in some aspect, that's fine. After all, it's your fantasy. Be warned, however, that unless certain balances are maintained, the game soon becomes very lopsided and very little fun. BALANCE is to be maintained at all times." - Tim Kask, Dungeons & Dragons Swords & Spells (1976), Foreword.
In any case fantasy is a growing and flexible form of gaming, and referees must feel at home modifying and expanding upon rules as the situation dictates. - Gary Gygax, Dungeons & Dragons Swords & Spells (1976), Introduction.
The terminology - "referee," "modifying the rules," still hew close to the wargaming metaphor. Also in Kask's quote You see the first time balance, or as he states it, "BALANCE", is mentioned. You'll see it again...
Basic Dungeons & Dragons - Moldvay/Cook
The 1977 version of Dungeons & Dragons births one of three major strains of thought on the issue of DM rulings.
Moldvay p.B2 (Foreword) on changing the rules: "In a sense, the D&D game has no rules, only rule suggestions. No rule is inviolate, particularly if a new or altered rule will encourage creativity and imagination." Paragraph 3 of the second column p.B3 also discusses how the rules are good as-is but should be changed if desired by the group and with the DM's permission. Also notable for using the term "rules as written", but only as normal descriptive English rather than a technical term.
Moldvay also has most of a page (B60) devoted to telling the DM that they're the boss, not the players or the rules. Notably, it has explicit guidance on making rulings when there aren't obvious applications of the rules. It also notes that though a good DM will discuss rulings with players after the game, a player who still disagrees is welcome to quit as their only recourse.
As you can see Basic moves well away from D&D's wargaming roots, gives the players a voice but puts the DM in the predominant place. I would venture to say that regardless of what the text of each game says, this became the predominant model of operation for the vast amount of the history of D&D.
Advanced Dungeons & Dragons - 1e
In first edition AD&D, you see further development of ambivalence between the role of the Dungeon Master and the beauty and balance of the rules, though the DM is still considered the apex. It departs from B/X in that players are pretty much actively denigrated. In the opening pages of the 1e DMG, Gary Gygax rambles on at some length on this exact topic.
What follows herein is strictly for the eyes of you, the campaign referee. As the creator and ultimate authority in your respective game, this work is written as one Dungeon Master equal to another. Pronouncements there may be, but they are not from "on high" as respects your game. Dictums are given for the sake of the game only, for if ADVANCED DUNGEONS & DRAGONS is to survive and grow, it must have some degree of uniformity, a familiarity of method and procedure from campaign to campaign within the whole.[...] In this lies a great danger, however. The systems and parameters contained in the whole of ADVANCED DUNGEONS & DRAGONS are based on a great deal of knowledge, experience gained through discussion, play, testing, questioning, and (hopefully) personal insight. Limitations, checks, balances, and all the rest are placed into the system in order to assure that what is based thereon will be a superior campaign, a campaign which offers the most interesting play possibilities to the greatest number of participants for the longest period of time possible.[...] Naturally, everything possible cannot be included in the whole of this work. As a participant in the game, I would not care to
have anyone telling me exactly what must go into a campaign and how it must be handled; if so, why not play some game like chess? As the author I also realize that there are limits to my creativity and imagination. Others will think of things I didn't, and devise things beyond my capability.[...] The danger of a mutable system is that you or your players will go too far in some undesirable direction and end up with a short-lived campaign. Participants will always be pushing for a game which allows them to become strong and powerful far desire is to issue a death warrant to a campaign.[...] As this book is the exclusive precinct of the DM, you must view any non-DM player possessing it as something less than worthy of honorable death. - Gary Gygax, Advanced Dungeons & Dragons Dungeon Master's Guide (1979), Preface pp.6-7.
You can see that player empowerment definitely isn't on the menu in the seventies, but there is a stronger strain inserted of the wisdom of the rules and how while the DM is still above the rules, they should tread lightly and wisely in changing them. After apparently sucking down some whip-its, he goes on to say:
Know the game systems, and you will know how and when to take upon
yourself the ultimate power. To become the final arbiter, rather than the
interpreter of the rules, can be a difficult and demanding task, and it cannot
be undertaken lightly, for your players expect to play this game, not
one made up on the spot. By the same token, they are playing the game
the way you, their DM, imagines and creates it. Remembering that the
game is greater than its parts, and knowing all of the parts, you will have
overcome the greater part of the challenge of being a referee. Being a
true DM requires cleverness and imagination which no set of rules books
can bestow. Seeing that you were clever enough to buy this volume, and
you have enough imagination to desire to become the maker of a fantasy
world, you are almost there already! Read and become familiar with the
contents of this work and the one written for players, learn your monsters,
and spice things up with some pantheons of super-powerful beings. Then
put your judging and refereeing ability into the creation of your own
personal milieu, and you have donned the mantle of Dungeon Master.
Welcome to the exalted ranks of the overworked and harrassed, whose
cleverness and imagination are all too often unappreciated by cloddish
characters whose only thought in life is to loot, pillage, slay, and who fail
to appreciate the hours of preparation which went into the creation of
what they aim to destroy as cheaply and quickly as possible. As a DM you
must live by the immortal words of the sage who said: “Never give a
sucker an even break.” Also, don‘t be a sucker for your players, for you‘d
better be sure they follow sage advice too. As the DM, you have to prove in
every game that you are still the best. This book is dedicated to helping to
assure that you are. - Gary Gygax, Advanced Dungeons & Dragons Dungeon Master's Guide (1979), Introduction pp. 9.
I'm pretty sure that would pull some flags here on RPG.SE if written today.
And then in closing out the pages of this hallowed tome, Gygax writes:
It is the spirit of the game, not the letter of the rules, which is important. NEVER hold to the letter written, nor allow some barracks room lawyer to force quotations from the rule book upon you, IF it goes against the obvious intent of the game. As you hew the line with respect to conformity to major systems and uniformity of play in general, also be certain the game is mastered by you and not by your players. Within the broad parameters give in the Advanced Dungeons and Dragons Volumes, YOU are creator and final arbiter. By ordering things as they should be, the game as a WHOLE first, your CAMPAIGN next, and your participants thereafter, you will be playing Advanced Dungeons and Dragons as it was meant to be. May you find as much pleasure in so doing as the rest of us do."
- Gary Gygax, AD&D Dungeon Masters Guide (1979), Afterword.
This marks an interesting change. In Chainmail and 0e the referee is just there to facilitate play between players. In Advanced D&D the DM has a predominant role and, while he is expected to become a master of the rules, reigns over the rules and players alike and can essentially extrapolate and make rulings according to his sovereign will.
Basic Dungeons & Dragons - Mentzer
Ah, my first Dungeons & Dragons - the Red Box. In the Basic player's manual, it briefly describes the DM as "the person who plays the parts of the monsters and runs the game" (p.23). I think it's so interesting that all the player books over time don't really expand on the DM role to players beyond one sentence of "this person's gonna run the game."
The Dungeon Masters Rulebook makes a dramatic break with all that has come before.
The Most Important Rule
There is one rule which applies to everything you will do as a Dungeon Master. It is
the most important of all the rules! It is simply this:
A Dungeon Master must not take sides.
You will play the roles of the creatures
encountered, but do so fairly, without
favoring the monsters or the characters.
Play the monsters as they would actually
behave, at least as you imagine them.
The players are not fighting the DM!
The characters may be fighting the monsters,
but everyone is playing the game to
have fun. The players have fun exploring
and earning more powerful characters,
and the DM has fun playing the monsters
and entertaining players.
For example, it’s not fair to change the
rules unless everyone agrees to the change.
When you add optional rules, apply them
evenly to everyone, players and monsters.
Do not make exceptions; stick to the rules,
and be fair. - Frank Menzer, Basic Dungeons & Dragons Dungeon Masters Rulebook p. 2 (1983)
The DM's role as described is exceptionally limited when you compare the parallel AD&D. Heck, the DM can't even change the rules without group consensus! All the advice in the first section harps on the fairness aspect. "so should the DM keep the “monster knowledge” completely separated from the “DM information."" It tends to assume the rules are complete and impartial application of the rules is all that is required in the game.
There is no explicit discussion of the GM using their judgment or making rulings at all. The rules section just says briefly that if the DM has questions they should 1) read the rules, 2) read some more rules, 3) ask an experienced DM, 4) send mail to TSR to get an answer (no, seriously). The only other mention is under the "Complaints" section that talks about listening to player complaints and admitting to your mistakes. The subsequent sets (Expert, Companion...) have exactly zero to say on the topic of the DM's dilemma of making rulings using their judgment except inasmuch as constructing the adventure and choosing monsters is within the DM's purview.
As you can see, BECMI takes the ideas from B/X and then apparently reacts against the strong strain of competition and DM entitlement in AD&D and swings way over in the other direction. Basic's decline came when 2e came out but its concepts get picked up much later by 4e.
The Second Edition DMG kicks in with a significantly different attitude towards rules, picking back up some of the B/X thread. Rulings are discussed explicitly and rules are put in the back seat in terms of primacy.
Choice is what the AD&D game is all about. We've tried to offer you what we think
are the best choices for your AD&D campaign, but each of us has different likes and
dislikes. The game that I enjoy may be quite different from your own campaign. But it is
not for me to say what is right or wrong for your game. True, I and everyone working on
the AD&D game have had to make fundamental decisions, but we've tried to avoid being
dogmatic and inflexible. The AD&D game is yours, it's mine, it's every player's game.
So is there an "official" AD&D game? Yes, but only when there needs to be. Although
I don't have a crystal ball, it's likely that tournaments and other official events will use all of the core rules in these books.[...] Take the time to have fun with the AD&D rules. Add, create, expand, and extrapolate.
Don't just let the game sit there, and don't become a rules lawyer worrying about each
piddly little detail. If you can't figure out the answer, MAKE IT UP! And whatever you
do, don't fall into the trap of believing these rules are complete. They are not. You cannot sit back and let the rule book do everything for you. Take the time and effort to become not just a good DM, but a brilliant one.
At conventions, in letters, and over the phone I'm often asked for the instant answer to
a fine point of the game rules. More often than not, I come back with a question—what
do you feel is right? And the people asking the questions discover that not only can they
create an answer, but that their answer is as good as anyone else's. The rules are only
guidelines. - David "Zeb" Cook, Dungeons & Dragons Second Edition Dungeon Master's Guide, Foreword (1989).
The DMG talks a lot more about the players' role in creating the story and in the DM's role in entertaining them. It does also mention its attitude towards powergaming:
A certain amount of min/maxing is unavoidable, and even good (it shows that the
player is interested in the game), but an excessive min/maxer is missing the point.
Reducing a character to a list of combat modifiers and dice rolls is not role-playing.
A mailing list debate from 2000 highlighting the difference in attitudes - 2e was more about freedom with less specific prescription, and some folks liked that and some didn't:
1st edition was very personal and idiosyncratic, and not to everyone's taste.[...] The second edition represents a shift in paradigm from this model (the shift
began, of course, right away, as the D&D rules quickly mutated in the hands
of individuals, but 2nd Edition was the first time it became evident in the
products produced by TSR). Where once there was a complete game found in a
few canonical books, now there is a nebulous web of possibilities spun
through any number of sources.
There are some good ideas in 2nd
edition[...] Other than that, my opinion is that it's a mish-mash of rules that nobody
ever took the time to playtest in conjunction with each other. Put the
burden on the DM? Like I need to have more burdens placed on me!
Some folks are more comfortable with a more constrained and prescriptive ruleset; 2e (along with a lot of the storytelling focus of that decade with Vampire and the like) sets the rules aside for the focus on story and DM discretion.
In the Dungeons & Dragons Third Edition Player's Handbook is the source of the term "Rule Zero" which is often used as shorthand for "DM discretion."
0. CHECK WITH YOUR DUNGEON MASTER
Your Dungeon Master (DM) may have house rules or campaign
standards that vary from the standard rules. You might also want to
know what character types the other players are playing so that you
can create a character that fits in well with the group. - Character Creation, Dungeons & Dragons Player's Handbook (2000).
Since then, Rule Zero has been expanded in the popular mindset to be "The DM Is Always Right/Can Do What He Wants" or, alternately, "Having Fun Is The Most Important Thing." It caught on as a term to describe judiciously breaking the rules - and the very fact that it did shows that there was erosion of the concept going on.
In the 3e PHB, it is pretty matter of fact about "Here's the rules. You'll be using them." Except for Rule Zero there's no mention of possible variation and no real discussion of the DM's role beyond:
One person in the game, the Dungeon
Master (DM), controls the monsters and people that live in the
fantasy world. You and your friends face the dangers and explore the
mysteries your Dungeon Master sets before you. - Dungeons & Dragons Player's Handbook, Introduction p.6 (2000).
The 3e DMG stats out with a whole chapter on the Dungeon Master's role. This edition talks a lot about the player role - "The players and the DM work together to create the game as a whole (p.8). The DM provides the adventure and the world and adjudicates, but they provide a whole checklist to guide adjudication and creating house rules. For adjudication, check the rules, check similar rules, if you make something up it's a house rule and you should be consistent with it for the campaign because "Consistency keeps players satisfied and gives them the feeling that they adventure in a stable, predictable universe and not in some random, nonsensical place subject only to the DM's whims. (p.9)"
For house ruling, the overall gist is to read the rules, understand why the rules exist, be careful about changing the rules - but still do it. "Given the creativity of gamers, almost every campaign will, in time, develop its own house rules."
I have extensive RPG mailing list email archives going back to 1997, and as I search for incidences of the phrase "rules as written," there's uses of the phrase all the way back but it comes into heavy use as a gaming jargon phrase on D&D lists in 2000-2001 with the advent of Third Edition.
My experience is that since 3e didn't really explicitly say a lot about the DM's role, 2e attitudes mostly carried over until 3.5e, when new players without previous edition experience and the more tactical rules focus enhanced in 3.5e caused a shift in attitudes not strictly prescribed by the difference between 3e and 3.5e text.
The 3.5e Player's Handbook still cites Rule Zero (though without the 0, so it's just a sentence in the Character Creation section). Its description of the DM role is:
The DM controls the monsters and enemies,
narrates the action, referees the game, and sets up the adventures. Dungeons & Dragons Player's Handbook, Introduction p.4 (2003).
The DMG is largely the same as 3e with some slight shading of language couching the DM's role and authority in more limited terms. "you control the pacing, and the types of adventures and encounters, the whole tenor of the game is in your hands (p.4)". Collaboration with the players is called out explicitly more. Also, the sheer magnitude of the rules and their attempt to cover all conditions makes the book more inherently readable as a self-contained guide to the game.
Gary Gygax had some harsh words for D&D 3.5 on this topic:
The new D&D is too rule intensive. It's relegated the Dungeon Master to being an entertainer rather than master of the game. It's done away with the archetypes, focused on nothing but combat and character power, lost the group cooperative aspect, bastardized the class-based system, and resembles a comic-book superheroes game more than a fantasy RPG where a player can play any alignment desired, not just lawful good. - Gary Gygax, GameSpy interview, Pt. 2 (16 August 2004)
Over the course of 3.5e, there was a significant culture change around rules adherence. WotC put a lot of work into their RPGA/Organized Play campaigns, and especially the Living campaigns had to, due to their format, enforce "strict rules as written" adherence. This generated debate, and as time went on, altered more of the default mode of players towards the rules being fixed above the individual DM's discretion.
The 4e DMG does a lot of recasting of the role of the DM. He is described "one of the players," a turn of phrase never used before in D&D, albeit a player with a special role (p.6) - "The DM is the rules moderator, the narrator, a player of many different characters, and the primary creator of the game’s world, the campaign, and the adventure." He "stands as a mediator between the rules and the players." If he makes a rules call during the session, it should be re-discussed later and he should "admit his mistake" and "make it up to the players." The tenor of this couldn't be more different from that of Gygax in AD&D, but you can see callbacks to BECMI in the wording.
4e does have a section on house rules (DMG p.189) as something "some DMs" might like to do, and allows that changing the rules is within your rights.
The word "judgment" in reference to the DM using their judgment or making judgment calls is used only 4 times in the 4e DMG, as opposed to 10 in 3e and 15 in 2e. In general it is stressed less in the text as a concept; implying that the rules handle most situations without that being necessary or desirable.
Another significant change here is the formal introduction of dissociated mechanics. In later 3.5e the concept had definitely emerged of "RAW, right or wrong" and that attempting to use game world simulation or physics was undesirable and you should just do what the rules say whether it makes sense or not. 4e codified that and formally dissociated the character powers into "rules first" mechanisms that can be skinned into the world however you want, but that have entirely deterministic effects not beholden to game world simulation.
(Yes, Pathfinder is a version of D&D, duh.) I'm out of space on this answer but the bottom line is much of their advice is cribbed from 3e, with slightly stronger statements echoing earlier editions about "All the rulebooks, including this one, are his [the GM's] tools, but his word is the law" "GM Fiat: The GM is the law of the game."
When complications involving rules interpretations
occur, listen to the player and make the decision as quickly
as you can on how to resolve the situation. If the rule in
question isn’t one you’re familiar with, you can go with the
player’s interpretation but with the knowledge that after
the game you’ll read up on the rules and, with the next
session, will have an official ruling in play. Alternatively,
you can simply rule that something works in a way that
helps the story move on, despite the most logical or
impassioned arguments from the players. Even then,
you owe it to your players to spend time after the game
researching the rule to make sure your ruling was fair—
and if not, make amends the next game as necessary.
It's worth noting the Old School Renaissance movement to bring back older versions of D&D, with its seminal "A Quick Primer For Old School Gaming" using the phrase "rulings, not rules" to try to describe the spirit of older editions as compared to newer editions. It cites these four pillars:
- Rulings, Not Rules
- Player Skill, not Character Abilities
- Heroic, not Superhero
- Forget “Game Balance”
Most of the time in old-style gaming, you don’t use a rule; you make a ruling. It’s easy to understand that sentence, but it takes a flash of insight to really “get it.” The players can describe any action, without needing to look at a character sheet to see if they “can” do it. The referee, in turn, uses common sense to decide what happens or rolls a die if he thinks there’s some random element involved, and then the game moves on. This is why characters have so few numbers on the character sheet, and why they have so few specified abilities.
Some, however, consider this to be a bit of a retcon of how old school gaming actually worked. As you can see from this research, it is and it isn't - the "rulings vs. rules" concept was very strong especially in B/X and 2e, somewhat less so in 0e/1e, and actively militated against in BECMI. Hackmaster and the Knights of the Dinner Table comic prominently parody the not uncommon rules-adherence mode of play in AD&D. As all nostalgia does, the Quick Primer picks certain elements out of the past to bring back and leaves aside some other elements.
The last D&D Next playtest packet has some very retro things to say about the interaction of DM and rules. "The rules are a tool that you and the players use to have a good time," "The rules aren’t in charge. You, the DM, are..." "the DM's power comes with responsibility. Be fair and impartial with the players." This last quote directly hearkens back to a quote from Zeb Cook's 2e introduction - "As a Dungeon Master, you have great power, and 'with great power comes great responsibility.' Use it wisely." D&D Next even goes on to discuss ignoring the dice - "The dice don't run the game. You do." This sweeps aside a lot of the underlying play assumptions of later 3.5e/4e and brings back a lot of B/X and 2e concepts.
Though in each edition you had some elements of each approach, there's a clear move in philosophy over time from
- 0e/1e the DM is large and in charge, the rules are pretty good, your players are at both's behest
- B/X and 2e the DM and players are both important, the rules are super mutable
- 3e/early 3.5e the rules and players and DM are level out in importance, meaning rulings are minimized and a negotiation
- BECMI/late 3.5e/4e the rules are pretty fixed and players and DM are equal and subject to the rules as law; RAW is an option
- OSR and Pathfinder splitting off in their own directions in reaction to 4e, OSR back to a mix of 0e/B/X attitudes and Pathfinder to a hybrid of 1e/2e/3e attitudes
- D&D Next is reincorporating a lot of the 2e and 3e thinking into the game