I've had to good fortune to work with two realtors who absolutely earned their commissions.
A good one helps you mitigate issues before they turn into lawsuits. For instance, some of the electrical work in one of my houses was, umm, questionable. One form asks whether the electrical system is up to code. Your options are, "Yes," "No," and "I don't know." I was about to mark "No" when the realtor stopped me.
"Are you a licensed electrical inspector?"
"No."
"Then how do you know that the wiring isn't up to code?"
"I don't."
"Then mark, 'I don't know.'"
Getting out of my lane would have handed the buyer's agent a lever to negotiate on price. After the sale, the same guy also decisively handled a couple of things where the buyer started to be a pain in the ass.
Good realtors will also have a battalion of landscapers, painters, handymen, plumbers, electricians, etc., who show up and fix things NOW. That's critical when you need to sell a house. Also, because the realtors feed them so much business, that they don't dare dream of trying to screw the homeowner.
That said, I fully recognize that there are plenty of shitty realtors in the world.
Okie John