Early role-playing games attempted to simulate fantasy novels, making up characters who go on adventures / find treasure / defeat villains. There's a typical progression where characters become more powerful over time: the puny farm-boy eventually becomes an arch-mage, the nomadic barbarian leads an army and becomes king. This gets implemented in game mechanics both by gaining material resources (treasure and gold) and with "experience points", an abstract numeric score determining what abilities a character has access to.
In some early RPGs there was a direct equivalence between gold and experience points - the characters are treasure hunters, their achievements are measured by how much treasure they bring home. In others experience points were awarded primarily for defeating enemies. Treasure and monsters are usually found in proximity so these are closely related, but there's a difference: if you sneak past a dragon and steal some of its hoard, have you really defeated it? Still others took a more high-level approach rewarding heroic quests completed. Different styles of play are encouraged depending on which specific actions are rewarded.
These RPGs were administered by a human storyteller, so they were able to have a certain looseness in their rules; the dungeon-master could interpret reasonable requests and deal with unexpected situations sensibly. When computer-mediated RPGs were developed it became necessary to make the rules a lot more precise and explicit. Rules that work in a tabletop setting could lead to undesirable side-effects in a digital game.
If we give the same reward for bypassing an enemy by any means (killing it, sneaking past it, bribing it), then what happens if you first deal with them non-violently and then turn back and attack them? This isn't the intended behaviour, but if you gain something extra from doing it then optimal play means doing it. But if you don't get anything from doing this, that doesn't really make sense - surely they have worldly possessions that you can loot from them, and if you gain experience from fighting why should fighting an enemy you've already walked past be any different? You can think of ways to deal with this, but a lot of games went with the simplest option: deal with all obstacles by killing them.
So okay we got lots of games about mainly killing, that's not so interesting. But now what happens to this system when there are multiple characters, multiple players? The absolute simplest way you might program it is: when an attack kills an enemy, give a reward to the source of that attack. But in a teamwork situation that doesn't make sense - whoever landed the killing blow might not be the one who contributed the most. Maybe you come up with a more complicated system where you track how much damage was dealt by each character, but that doesn't quite work either - different character roles might deal less damage while still contributing as much to the group (a healer, for example). Maybe just divide rewards evenly amongst everyone involved: this is fine in a strictly cooperative setting, but outside of that it might create an incentive to jump in at the last moment to get a disproportionate share.
Now consider Dota 2 (and family). The basic setup is a battle between two armies in which the human players (five a side) control heroes that help out and influence the outcome of the war. The heroes advance in the now-typical CRPG manner, earning gold and experience for killing enemies. But the beautiful, absurd thing Dota does is to embrace the side-effects of specifically rewarding the killing blow. Experience is divided among everyone near a death, but gold is only given for getting the last hit, resulting in this weird bureaucracy of trying to get the reward from a fight without contributing much to it. It takes a buggy implementation of an oversimplified computerisation of a broken tabletop mechanic and expands it out into its own thing (it's the Game Title: Lost Levels of RPGs). It still pretends to simulate heroism, but in fact we roleplay heartless generals waiting while their armies slaughter each other, jumping into the fray only when the outcome is already decided in order to claim the glory. Indeed it encourages helping in the fight as little as possible, for a surfeit of success is unprofitable - it advances the battle into the opponent's territory before you're high-enough level. We sit back and watch the little people die until we secure more funding. It's pretty realistic.
And hey then also you can "deny" last hits, stabbing your own soldiers in the back to prevent your opponents getting the rewards for killing them. WHAT. This arose as a natural consequence of the previous rule but was then made explicit with the game indicating it with a unique animation and sounds.
CAN A VIDEOGAME MAKE YOU FEEL REAL EMOTION SAY SOMETHING MEANINGFUL ABOUT THE HUMAN CONDITION BE TRUE ART.
Well what about this lovely depiction of how rules can have consequences contrary to their intended effect, how when you make laws to encourage people to do something they'll figure out what the incentive actually measures rather than what you meant them to do, how we can appear to be doing one thing while actually achieving its opposite.