Many people have a favorite author or a book that has inspired them. And while the person who writes the work is the one that comes up with the ideas and the brilliant prose, it would never make it to the shelves and into people's homes without a good editor. While you might think that the majority of their work is checking for typos and making sure that authors meet their deadlines, there is actually much more to being an editor. And every book, from a novel to a world history textbook likely has several people working on it before it goes into print.
The primary job of an editor is to work with the author to produce the best book possible. This means doing everything from helping them through writer's block to working with them on the wording of a particular passage. You will find that editors usually specialize on one area of writing. Some might be better at working with authors who write medical books while others could work on children's books. An editor needs to know the material as well as the author themselves in many situations. The role of an editor in relation to the writer is akin to the role of an accountant to a bookkeeper; he is the one to review the work with an eye to ensuring that it will be acceptable to the end user - the reader in the case of the writer, and the shareholder or bank manager in the case of the bookkeeper. As an aside, more information about the role of an accountant can be found here.
A good editor is going to be the coach and the confidant of an author throughout the rewriting process. This is a time when they are getting notes that are going to help tell the most compelling story or those that are going to help them turn their experience into a book that anyone can relate to. But, before an editor can do that, they need to choose the authors that they are going to work with and the books that they are going to help publish. This means staying on top of news stories and what people are interested in today. It means finding that gap that needs to be filled in the market, whether you're someone who wants to publish works on landscaping, history, or a science fiction epic.
There are many authors who are able to live relatively simple lives out of the limelight. They don't need to be terribly social and can spend their time just doing what they love and creating new worlds. Their editor is the one who is going to work with all of the different departments of the publishing house to choose the cover for the text on architecture or the latest romance novel. They are the voice of the author throughout the process. Sometimes they are going to work as a buffer to make sure everyone is working towards the same vision and sometimes they are going to be the person that is making sure everyone's work is done on time.