The issue isn't that the Ranger is weak.
It is that the player base and WOTC culd not agree towhat the Ranger was. It was the most heavily changed class in all of D&D. 5e wasto bring back old feeling of D&D but anger was all over the place. So WOTC just jammed class features that everyone agreed on for names then put the power in Subclass and Spells. This made the Ranger the only Ribbon and Subclass class. It is a archetype focused spell casting warrior who focused on the exploration pillar. Ranger was more or less purposely designed to have its strengths not in the Class Features section. Ranger power is placed in the Subclass, Spells, and Exploration sections.
There might be a reason for this approach. Past Ranger class features have always been in 3 camps:
- Situational flavor abilities
- Overpowered general features with meaningless restrictions or drawbacks
- Tamer versions of other classes' features
So it is possible that the design team attempted to avoid this probblem again by downplaying the traditional expected aspects of the class. They might have decided the base class features focus on the flavor and put the power in the part of the class players have choice in: subclasses skills, and spells.
WOTC however were to conservative on the first subclasses. Spells were heavily tilted to wizards. And the exploration pillar was poorly handled as well. This is why when XGTE entered the fray, the Ranger suddenly grew in popularity. After the playerbase complained and aired their greivances. WOTC just upped the combat strength of the class and shrugged it off. The Ranger shows the danger of making classes focused on their subclass for strength.
TLDR: Rangers is the only class that is based on it's subclasses, skills, and spells and not base class features. This is because the playerbase cannot agree to what a Ranger is and the designers didn't want to take a stand in a nostalgic edition. Unfortunately the designers screwed up the Ranger's subclasses and spells at release..