The RNG has some useful functions. It can introduce a lot of variety into the game if things are randomised at the start, and bad start positions tend to be less frustrating than being struck down late game by an RNG "act of God". It's still kinda fun to play at a disadvantage, as victory gets more rewarding as it becomes less probable.
Giving bad players a chance to win against good players is arguably a good thing for the overall health of a game. Any group of players will have some who are less skilled, and if those players always lose then they will quit, until the playerbase essentially disappears. However, this doesn't need actual randomness, for example short health bars in brawlers allow a bad player to win with a few lucky hits, even without a real RNG, while long health bars tend to guarantee victory for the stronger player.
Another thing RNGs do is smooth out numerical weirdness. For example, the Protoss Reaver in Starcraft has an upgrade that allows it to do 125 damage instead of 100. But there aren't any units in the 101-125 hitpoint range that would require the upgrade to 1-hit, so it is a lot less useful than it might seem. Other units get upgrades that do let them go from 2-hitting enemies to 1-hitting them. With a random damage range, a 10% damage boost tends to kill enemies 10% faster. However this is not really RNG from a game design perspective because it is intended to average out and make the game more predictable.
It should be noted that there are types of luck beyond RNG luck. There is execution skill, for example a good golf player is more likely to get a hole in one but is still lucky when it happens. There is rock-paper-scissors luck, where mind games can happen but it's mostly just guessing. There is also luck in unclear outcomes, for example in chess you can see all the pieces but you cannot fully calculate the consequences of moving them, so there is an element of guesswork.
Question: Why do you rage if you call heads and the RNG says tails, but not if you pick paper and I pick scissors?