When a goblin dies to a fireball but doesn't die to a 2-hp longsword wound, it's "lore."
No, it's straight mechanics:
The goblin has 5 h.p., the fireball does 16. End of goblin.
The next goblin has 5 h.p., the longsword does 2. Goblin fights on.
Fireballs more reliably kill goblins than longswords in the lore because they do so in the mechanics.
Lore has nothing to do with it. The goblin lives or dies in these examples by sheer numerical mechanics, nothing else.
Where lore comes in is the narration of the in-game effects of these mechanical events: "The goblin screams briefly then falls silent as its charred corpse crumples to the floor." "The sword hits the goblin hard, staggers it a bit, and puts a small cut in its shoulder; but the creature looks determined to fight on.". And there's nothing whatsoever that says these narrations have to be the same every time, or even ever the same twice...the narration is not bound by any rule saying what they must be or say. The only expectation is that the narration will at least vaguely hew to what the underlying mechanical results suggest.
Again, I think this distinction between "mechanical" rules and "non-mechanical rules" isn't a meaningful distinction. D&D is played by pretending to be a character, and the mechanics of pretending to be a character include referencing backstory. That is one mechanism by which "pretending to be a character" is accomplished. Backstory is a mechanic.
Different definition of 'mechanic' than I (and I suspect others) would use.
A mechanic is something that is hard-coded, usually with numbers attached somehow; and is either a rule unto itself or is part of one. "A Dwarf character gains +1 Str +1 Con and -1 Cha" is a hard-coded game mechanical rule.
Lore is something else, much less definable or code-able, and falls under guidelines rather than rules. "Dwarf characters tend to be tougher than most, but also tend to be harder to get along with" is a set of guidelines only, but not a rule unless there's something somewhere else that mechanically reflects that lore by changing the numeric stats for Dwarves.
It's also useful to see things through that lens, because it avoids entrenching or trivializing either of these things, and recognizes that using backstory is like using encumbrance: it's something some players get a kick out of, but others might not. You can also find different rules that work at different tables. Perhaps you have some other mechanism to use backstory that works better for your group. Perhaps PC's in your campaign have no backstory, and you're cool with that. Backstory, encumbrance, these things are in the same category: they tell you how the game is played.
Well...not quite. Encumbrance tells you how the game is played and has specific mechanical ramifications e.g. move rate. Backstory helps to (but does not fully) tell you what might make your character tick and gives you some RP ideas to flesh out, but most of the time has no mechanical impact whatsoever*.
* - unless your game is using some sort of social-status mechanics a la Birthright, but that's a corner case.
Lan-"despite how it might seem from what I'm posting these days, I really do prefer a rules-lighter type of game"-efan