During the submission process, the advantage to having an agent is only that a good agent can place a manuscript directly on a top editor's desk. When you submit directly, you'll probably have to go trough an assistant first, if you can get there at all. Some few publishers simply will not look at anything that doesn't come from an agent.
Knowing which editor to send to is easy. You don't have to be an agent to figure this out. It's child's play. If you can't find the right editor to send the book to, you need to hone your research skills.
And contrary to popular belief, every agent does not know every editor out there. Many selling agents only know a tiny few, and once these are exhausted, they either stop submitting, or submit as blindly as a new writer. Agents are also notorious for not wanting to sell to publishers that don't offer large advances.
It is better to get an agent first, if you can, simply because a good agent can get your manuscript looked at by the top houses that simply will not look at anything that comes directly from writers. But once away from those particular publishers, a good book sells, whether submitted by an agent or a writer.
And, of course, problems landing an agent or a publisher may have nothing to do with the quality of the novel itself. A bad query letter kills even the best novel, and this is true with agents and with publishers. I believe a writer should always include the first three to five pages of the manuscript along with a query. Good first pages can make an agent or an editor request a manuscript, even if the query itself is ho-hum.
And some publishers, Tor, for example, want to look at the first three chapters, rather than a query. Baen wants the complete manuscript. This is a decided advantage for the writer. If you get rejected, at least you know it was the manuscript being judged, not just the query letter.
I always suggest trying to get an agent first, but there aren't very many really good agents out there in most genres, and if you can't land a good one, you're better off with no agent at all. I know some writers query hundreds of agents, and it's silly. I doubt any genre has more than two dozen or so really good agents. If you can't land one of these, or at least a very promising upstart agent who has worked for a larger agency and is now on her own, or sometimes a former acquisition editor turned agent, you're better off waiting until you can get one of these, rather than going with a mediocre or poor agent.
So once the top thirty or so agents have said no, I think it is a good idea to go directly to publishers. They can surprise you, and one of the biggest complaints many editor have is that too many agents just send them same old, same old, and won't take a chance on something new and different.