In most cases, a literary agent is responsible for selling an author's book to a publisher. An agent acts as a liaison between author and publisher, negotiating the publishing contract to benefit the author. Some publishers accept pitches and manuscripts directly from authors, but this is not usually the case.
For works of fiction, agents usually only consider completed, polished works and tend to work with authors in specific genres. For nonfiction books, a finished manuscript is not necessary; instead, authors and agents pitch books, and publishers decide if the book is the type of work that they would publish.