The companion can make perception checks (often with advantage), move, react, block movement, be a target, heal a limited amount on a short rest (I'd like to see this fixed), heal to full on a long rest, make death saves, and act as a replacement character any rounds where you character is down. That's just at 3rd.
For the price of not making an extra attack some rounds or an extra 1d8 once per turn. And sometimes it can allow you two reaction attacks.
The current default pet is a Giant Poisonous Snake with an average damage per attack higher than a greatsword and a better attack bonus than available with point buy (+8 attack, 10' reach, 8 (1d4+6) plus DC 11 Con save for 12 (3d6+2) poison, half with a save). AC 16 is pretty respectable with 18 hp. (DM basic rules, p.27 or Appendix A, MM)