There are two basic editorial functions which any manuscript needs to go through before being submitted to agents and publishers, or for self-publishing: copy-editing and proof-reading. Think of them as the literary equivalent of that last look in the mirror before going for an interview, or to a party. Just a final check that your work is shown off to the best possible advantage.
Before any book is published in the UK market it will have been copy-edited and proof-read by the relevant publishing house.
A copy-editor will look at the manuscript at several levels, ensuring the structure and language are appropriate for the book's intended audience, that the narrative is clear and flows well, and that there is consistency in characterisation, language, tense and viewpoint.
Perhaps a sentence or paragraph is too long, or tautologous. Maybe some paragraphs (or scenes) could be taken out completely, to speed up the action, or because they repeat something earlier in the text. It may simply be that there are too many speech tags, or one or two words crop up too often.
Checks spelling, grammar and punctuation, without touching the text in any way. By its very nature, a copy-edit will always include a thorough proof-read of the work.
Here’s an example of a book I’ve recently edited.