What's any story set in the real world about? There, the lore is all pre-established (by being reality). Since stories in the real world can basically be about anything, so can stories in any gameworld with pre-defined mechanics.
This is how tabletop games work. The mechanics come in a book, and the players create stories using those mechanics.
Furthermore, there's never any plot until the game gets played. The game's narrative is the story of the player's choices. Those choices are informed by gameplay mechanics. So how does the story work at all if the mechanics don't apply to it?
One advantage of table top games is you aren't limited in what you can do gamewise and each character basically controls the entire reality of the games world.
In a video game you don't have such freedom, and never will. You will always be bound to the limitation of what the creators could or could not account for in the game. I can't complain about not being able to just not save the princess and side with bowser in mario because the creators of the game never decided to have that be a possibility.
Now, the reason story and gameplay are segregated is because nobody enjoys playing a game in which one strike from a sword could kill you. If that were the case dark souls would have outsold circles around all other rpg competition, but it did not. Nobody wants a game where their character is auto-controlled for chosing a certain class, as is the case for being a mage and possibly falling to demonic influence. And again, there isn't going to be some questline you and the DM discussed to help get your character back or discuss the ramifications of this stuff before hand. Its you, and an AI DM, following commands written for it, with no empathy or even ability to precieve your complaints against it. That is why the devs make gameplay exceptions to lore, becaue they want people to have fun playing the game.
Roleplaying games aren't games at all.
The point of a computer roleplaying game, I insist, is to mimic the gameplay of tabletop roleplaying games without the need for other players. And tabletop roleplaying games are not games. They are activities, like hiking or stamp collecting. There's no end point. There's no victory or defeat.
You are highly mistaken in what a video game roleplay is. They are a choose your own adventure book, with on the rails stories, and a host of activities to distract you from the fact that your decisions were mapped out ahead of time, and you are only being allowed to choose what path you go down.
In RPG's you have more freedom, sure, but lets not pretend that there isn't a fundamental difference between tabletop games and role playing video games. You can't negotiate with the leader of the campaign for your character to fit in the story, nor can you have any sort of dialouge about the plot. ITs preset, these are your choices, follow them or do not play.