Why is the PHB Ranger considered underpowered?

It seems that both the community and Wizards of the Coast are largely in agreement that the PHB Ranger class is underpowered compared to the other classes.

What exactly makes it underpowered compared to other classes?

More specifically, how does the 2019 UA Ranger improve on the PHB Ranger’s weaknesses?