Rules as written is first-and-foremost an approach to understanding the rules text of a system. As an interpretation of the text, it has the following goals:
Accessibility. A rules-as-written interpretation should be one that anyone reading the rules can come to, and so is based solely in the published rules, without injecting any external knowledge that may be unavailable. Examples of external knowledge that are eschewed include developer commentary (unless that commentary is given official rules-status, as in errata), historical precedence (unless that precedence is found within the rules), narrative concerns, balance concerns, or anyone’s idea of “common sense.”
Universality. A rules-as-written interpretation should be one that everyone who reads the rules text and rigorously applies the literal interpretation of that text (even up to or beyond any limits of absurdity) comes to. If the text is irreconcilably ambiguous, then the RAW interpretation would then be a list various possible interpretations based on different interpretations of any ambiguities.
Officiality. A rules-as-written interpretation should endeavor to incorporate the entirety of the “official rules,” as defined by the game’s publisher, with the exception of those tied explicitly to adjudication by any player or players (e.g. a Game Master).
Thus, the ideal RAW understanding of the rules is one which everyone reading the rules will come to, without needing to know anything outside the rules, and that this understanding is, say, “official-compatible.” This ideal is, of course, rarely achieved. Rules text is often ambiguous, some contextual understanding is simply required to understand any language (and English arguably more so than most), and the official rules may explicitly contradict some of the other goals (i.e. Rule 0, enshrining developer commentary as official, and so on).
The purpose of this exercise is not necessarily for play; while someone could blindly adopt RAW interpretations as the rules they will actually use for a game, and thus RAW could be called a “playstyle,” this is really a twisting of the term. For one thing, it tells us nothing about what the style of play will actually be like, which is the sort of thing that a “playstyle” would ordinarily indicate, and for another, in many cases it’s not actually possible (if for no other reason than that RAW is an ideal to pursue rather than a goal to achieve in many cases).
Rather, the purpose is to facilitate communication about the rules. Historically, rules-as-written approaches to understanding the rules became far more prominent with the rise of the Internet, and that is no coincidence. While RAW interpretations are prone to many, many flaws when it comes to actually playing the game, ideally RAW provides a foundational basis of the rules that everyone can at least agree on. This is important when you are talking with people with whom you have never played, and who bring entirely different assumptions, history, and preferences to the discussion, and there is no one with a DM’s authority to decide things between you. That’s when RAW becomes useful. Online, we can’t make any assumptions about how someone else’s DM will rule, so in a sense, RAW is intended as a way of minimizing assumptions that may not be true (and, when the rules are well-written, it serves this function well—but RAW tends to only get a lot of attention when the rules are not well-written and the RAW is surprising).
Compare this to actually sitting at a table, particularly with a stable group that has played together for a long time. Within individual groups, such a drive for “objective” understanding is unnecessary; the goal within a group is to play a fun game, not necessarily to come to some perfect understanding of the rules text. And when the rules as written offer results that are counterintuitive, imbalanced, or just nonfunctional, you have a DM there to adjudicate things.
The language of the rules, interpreted literally, also becomes a vehicle for changing the rules and communicating those changes—in short, RAW provides a way to understand what the rules are and a language for indicating what your houserules are as well. By using the language of RAW to change the rules of the game (particularly those places where the rules of the game are unsatisfactory as written), the goal is to add clarity to one’s game, and avoid miscommunication and the resulting social fallout that can come with it (arguments about what someone said and what that meant, disappointment or frustration when things don’t work as expected, etc.).
Best Answer
“Rules as written” is a subjective method of interpretation.
I want to to just say “no”, but it isn’t quite as simple as that. “Lore” and “rules as written” aren’t the same category of thing.
“Rules as written” is an interpretive method. It attempts to minimize the amount of inference brought to a ruling by providing the most plain reading of the text the reader can come up with. Even this is highly subjective. I disagree with others all the time on this site about what exactly the “rules as written” reading of a rule should be. I would ask “according to who?”, because there is no universal standard for “rules as written”. It’s a tool in the toolbox of players for understanding how to play the game, and different players are going to apply this differently, different DMs are going to use this tool differently when running their games.
It simply doesn’t make sense to point at a text and say “this is rules as written”, that would be a category error. “Rules as written” is a method of reading the text, not a property of the text itself.
Rules text and lore text are different sorts of things.
Lore is an entirely different type of information from rules. Rules text is player facing, lore text is both player facing and character facing. Rules text is put together using language the players understand, and the rules text doesn’t make sense to the characters. But lore text is understandable by the characters in the fiction of the game universe. We should not expect a DM to just change the rules of the game, but the DM can be expected to change lore to suit the world they want to build.
So these are entirely different types of text with different purposes, generally speaking. However, as you have pointed out, the Monster Manual can make this distinction blurry by framing stat blocks with text about the monster, as well as providing insight into what a monster is capable of, and even what rules might apply to it. The line between rules and lore isn’t always clear. But this is okay because:
World building is the DM’s responsibility.
The introduction to the Dungeon Master’s Guide calls the DM the “Master of Worlds”. Putting together the lore of the world is the DM’s job. So when it comes to the lore texts in the various published materials, it’s up to the DM to use them or not, and how they are to be used. If the DM wants to apply a “rules as written” method of interpretation to a particular section of lore, they can do that. The Monster Manual is explicit about this:
So the DM can approach lore with a “rules as written” frame of mind, or they can chop it up and rebuild it however they like.