It really depends on the game.
Some games, like Final Fantasy, I see it as enemies in the wild ambushing you. I think it is like a "translation" of when you are playing tabletop RPGs and the party is traveling from one place to another and the dungeon master rolls the dice for the random events: could be a peaceful encounter, or it could be a fight.
It can be a good way to keep the player paying attention and break the monotony.
There are games with horror elements, like Laplace no Ma and Sweet Home, or even harder games, where the random encounters add to the fear element. Do I have enough resources? Am I strong enough? Will this encounter be the last? It can enhance the mood in fun ways.
But there are also those games. Those games that every two steps you are thrown into a random battle. The games with unreasonable encounter rate that only exist to increase the length of a game. Unless the game is really good, it can go hug a cactus.