Literary agents handle contract negotiations for their authors and take a percentage of the advance the author receives.
Essentially literary agents act as an author's representative (and champion) in the book publishing world. A literary agent helps an author get his book published by submitting the author's manuscript to editors, editors that the agent likely has a standing relationship with.
A literary agent also helps an author navigate his longterm career. To find out more about the job of a literary agent, check out this article.