Agents and publishers see an amazing amount of crud (well, they see it briefly, it gets a first page lookover from where the quality or lack of it is easily seen). EVERYONE thinks they can write a book and a lot of those who DO write that book have never so much as read a book before from the looks of it.
So, a huge amount of unsolicited stuff that comes in front of an agent or a publisher is unreadable, stream of consciousness, lacking in story arc or character arc or plot of any kind.
Having your manuscript evaluated, or read through by someone who knows what they are doing, or edited professionally before sending it out anywhere means that you can have a head’s up about any problems in time to fix them before submission. It saves you from sending something which may have a MASSIVE fault which will prevent anyone else from taking it seriously.