Depends on the type of sourcebook and also the game.
In a game where the lore and the rules are tied together (like Vampire, Star Wars, Cyberpunk Red, etc.) as opposed to setting generic (D&D, GURPS, Fuzion, etc.), the lore is what sells the game. Even then, though, not all sourcebooks are created equal. But since this is a D&D-specific thread, let's just talk D&D.
If it's a setting sourcebook, more the lore is the most important part (IMO, the only rules that a setting book should include are rules that facilitate playing the setting, like new races, subclasses, etc. as applicable). Rules expansions that aren't setting-specific should have more or less minimal lore that is generic enough to be easily replaced with some suggestions and examples of how they fit (or can fit) in different settings.
I'm not a big fan of thinks like Volo's, Mordenkainen's, which has a ton of lore that is supposed to be generic (but ends up contradicting the established lore of several settings—even the most generic settings). If I'm playing a specific published setting, much of that lore is useless to me (because it doesn't fit said setting), and if I'm homebrewing my own setting, I want to create most of the lore myself, so it's again useless.