It’s amazing how many submissions a publisher receives—dozens every day, thousands over the year. Very, very few of them are ever acquired, because very few of them are really what the publisher is looking for. There aren’t that many editors; it’s not a big business. Generally speaking, editors want to work with agents they know who have provided them with good books or book proposals in the past, an agent who knows what they’re looking for. (I should note that here I’m talking about the editor at a traditional publisher who chooses which books to publish; there are also freelance copy editors and so on whom you may work with while getting your book ready for publication, but that’s not quite the same thing).
There are editors who specialize in memoir or general fiction or mystery or science fiction or cookbooks. It’s an agent’s job to know who specializes in what. When I was at Jossey-Bass, I sometimes got submissions for cookbooks and chemistry textbooks, but we didn’t publish those kinds of books at all. An agent who knows which editors are looking for what kinds of books can help you avoid that mistake. There are exceptions, but most books that are purchased for publication come through agents. So yes, if you’re interested in publishing traditionally (even if you’ve already self-published), you need to have an agent.
I say that with some ambivalence, because as an acquisitions editor, agents have always been my best friends and worst enemies. They bring me good books, but they also negotiate to get as much money as possible in exchange for those books. My job is to pay as little as possible for a book, and the agent’s job is to get me to pay as much as possible. As an author, you want an agent on your side in that negotiation.