Some of the descriptions of 'hostile players' or those demanding to know how things work "behind the screen" make me glad I have the group I play with, where it never ever comes up.I have Jotn the Innkeeper...who is immune to charm spells. I just say so and the game moves on. Until one hostile player climbs up on a High D20 and demands to know "how, by the offical rules" the innkeeper has that ability. So then I make up a full character write up, "using the offical rules" and make Jotn immune to charm spells. So now the player is all "happy" as they know all the "rules" that give the innkeeper that one ability.
If an innkeeper had that ability to be immune to charm, we would assume it was either a magic item, or some 'retired adventurer' type ability. No one would ever actually ask. And if they did, they'd be told "that's for you to find out, if it really matters to you." As in, in-world. Role playing opportunity, activate!
And "monsters" used to be "by the book" to so speak, but over the decades, we never rely on our "meta knowledge" of monsters, because we all know now that we change them up from what is printed, give them different abilities, etc. Only the NPC's (humans, elves, dwarves, etc.), and some monsters like Liches, Vampires, Death Knights, etc. might have actual class levels, and they're built like the PCs.
My most memorable antagonists in campaign were the NPC's with class levels. One campaign, my castle I had built (1e?) was attacked by a lone Cleric who began to tear down my castle with a summoned elemental and then proceed to pound me (at 10th or 11th level Fighter) into the dirt in melee until I made a ridiculous round of rolls and won with single digit hit points remaining. We still talk about that 30 years later.