It provides a safe space in which two people can talk through their problems, issues and emotions while being guided by a neutral third party, who’s also a trained professional in handling emotions and conflict.
It’s not a magic wand to fix things, and it’s useless if both people don’t actually want to improve their relationship. But you have a lot of cases where both people really do want to make things better, but they can’t seem to talk about their issues without devolving into blame, argument and futility. Having someone to guide things, to calm emotions when they fray, to encourage open communication, and to make clear what conduct is and isn’t acceptable, can be a very valuable thing in helping a couple to get along.
A marriage counselor (like every other kind of counselor) can’t fix things for you. What they can do is teach you the tools and guide you on the path to fixing things yourself. Some couples have fantastic communication already, and don’t need a counselor (and those people generally don’t feel the need for one). In some couples, one or both people aren’t willing to do what it takes to make their relationship better, in which case there’s not much a counselor can do.
But there are literally millions of people who have relationship problems, and both people want to fix them, but they can’t quite seem to get there on their own. In those cases, counseling can help a great deal. We shouldn’t treat it like a cure-all, but it’s a potentially useful resource.