A lot of people recommend agents. I've heard advice that an agent's job involves a lot more than just finding a publisher for your novel, but no one really says what else their job entails. What else does an agent do that makes them so valuable?
This question is crying for a link to the Sacred Cows of Publishing Killing.
Finding a publisher is not their main task (at least it wasn't). They negotiate contracts. That's what they are/should be good at, but most authors probably not. They watch for irregularities in the publisher's payments (and you should watch the agents).
They also give advice what to write and how to write. The link above raises the question, why they should be able to give that advice, because if they really knew it, they would write novels themselves and would make more money.
So there is a debate if they are really that valuable. I don't know. I neither have an agent nor have I sold a book yet.
Edit: Wikipedia knows how to explain it better than I do.
A literary agent is someone who represents writers and their written works to publishers, theatrical producers and film producers.