The main issues with the Ranger are due to the weakness of the first two class features, Favored Enemy and Natural Explorer. Here's the rules text (from page 91 of the Player's Handbook and the Basic Rules):
Beginning at 1st level, you have significant experience studying,
tracking, hunting, and even talking to a certain type of enemy.
Choose a type of favored enemy: aberrations, beasts, celestials,
constructs, dragons, elementals, fey, fiends, giants, monstrosities,
oozes, plants, or undead. Alternatively, you can select two races of
humanoid (such as gnolls and orcs) as favored enemies.
You have advantage on Wisdom (Survival) checks to track your favored
enemies, as well as on Intelligence checks to recall information about
When you gain this feature, you also learn one language of your choice
that is spoken by your favored enemies, if they speak one at all.
You choose one additional favored enemy, as well as an associated
language, at 6th and 14th level. As you gain levels, your choices
should reflect the types of monsters you have encountered on your
You are particularly familiar with one type of natural environment and
are adept at traveling and surviving in such regions. Choose one type
of favored terrain: arctic, coast, desert, forest, grassland,
mountain, swamp, or the Underdark. When you make an Intelligence or
Wisdom check related to your favored terrain, your proficiency bonus
is doubled if you are using a skill that you’re proficient in.
While traveling for an hour or more in your favored terrain, you gain
the following benefits:
- Difficult terrain doesn’t slow your group’s travel.
- Your group can’t become lost except by magical means.
- Even when you are engaged in another activity while traveling (such as foraging, navigating, or tracking), you remain alert to
- If you are traveling alone, you can move stealthily at a normal pace.
- When you forage, you find twice as much food as you normally would.
- While tracking other creatures, you also learn their exact number, their sizes, and how long ago they passed through the area.
You choose additional favored terrain types at 6th and 10th level.
The first issue with those two features is that neither one does anything in combat. That's a little bit problematic when combat is one of the three pillars of adventure, and probably the most universal one. Some campaigns will not have too much social stuff, others skip over most details of exploration. But hardly any D&D game will skip combat. Every other class gets features at first level that function at some level for combat. Sure, it might be possible for a Ranger's abilities to give their party an in-combat advantage by setting them up to ambush their foes or something, but that relies upon a lot of player cleverness or DM assistance, and doesn't flow automatically from the abilities themselves.
The second issue is that the utility of Favored Enemy and Natural Explorer outside of combat is highly polarized. When they're not useful (perhaps because they're not in their favored terrain nor confronted by their favored enemy), they do nothing at all. This is very common if the Ranger's player and the DM haven't coordinated at the start of the campaign. But even when they are useful there can be problems. If they are useful at all, they're very useful. Maybe too useful, to the extent that they remove all of the challenge of one part of the game.
Because of this, a group facing those challenges who has an appropriately specialized Ranger may just end up skipping over them, especially after the first few times the Ranger helps them breeze through the challenge. "Oh, the Ranger can effortlessly guide us through the 'deadly' forest because that's his favored terrain, so lets not waste our time counting rations and making survival checks and just jump ahead to when we reach the dungeon in a couple days." Or the DM might think: "Hmm, what monsters should have kidnapped the blacksmith's daughter? Orcs are the Ranger's favored enemy, which would make tracking them trivially easy, so I'll go with goblins." A Ranger may thus never get a chance to shine at their specialty because they're just too good at it.
There are some further issues with the Ranger subclasses in the PHB, that are mostly improved upon in other more recent subclasses. One major problem is that the Beastmaster's animal companion is too squishy to survive long in combat against tougher monsters and losing it, even temporarily, them makes the subclass weaker and breaks its theme (it's hard to be a Beastmaster when you don't have a beast to be master of).
Unsurprisingly, these are among the features that the Class Feature Variants document from Unearthed Arcana offers alternatives to. It offers replacements for both of the PHB Ranger's starting features, and also some buffs for the Beastmaster. There are also more options to improve Ranger spellcasting, including giving more options for spell selection, and offering an alternative third level class feature that lets a ranger know and cast certain utility spells without using spell slots or their limited spell selections.