This is a complicated question, and one that could easily inspire an essay in response. (No seriously—Michael wrote an essay about why he loves agents that appeared in a Children’s Writers and Illustrators Market years ago.) But here is a short answer: Most publishing houses have closed their doors to unsolicited manuscripts, so an agent is direly important in getting your work through the front door.
But more importantly, a good agent puts your manuscript in front of the right editors in the house—those whose tastes are attuned to what you do. That’s the agent’s job, to get to know the ins-and-outs of each editor’s tastes at the different houses, something a writer can’t do because she’s busy writing.
As well, an agent handles the ugly business side of the relationship—making sure the author is adequately compensated and that subsidiary rights are aggressively exploited, and more—things that an author shouldn’t be focusing on. The agent insures that the editor/author relationship can remain a pure one, about the work at hand and not why a check is late (or what-have-you).