It's a common misconception that "editing" encompasses only grammar, spelling, and punctuation. In reality, there are many different kinds of editing. The type of edit that's recommended to you by your editor or publisher will have different implications for your manuscript.
Let's start with the basics. The simplest kind of editing is a copy edit, which looks at what we like to call "surface level issues." Grammar, spelling, punctuation, and maybe a few redundant or repetitious phrases will be corrected here. Nit-picky things like Oxford comma use, correct em and en dash placement, and the over- or under-use of semi-colons and exclamation points will be corrected here. A copy edit is typically recommended for manuscripts that are well-developed and sound from a continuity perspective.
Next, we move into line or content edits, also sometimes referred to as substantive edits. Here, we might make suggestions to revise words for clarity, consistency, and often continuity. Sometimes this means we need to point out logical fallacies or weakness in an argument (for non-fiction) and sometimes it means we need to make suggestions for revising awkward phrasing or getting rid of "fluff," i.e. extra adjectives and adverbs. Help with transitions between sentences, paragraphs, or chapters may also be needed.
The third kind of edit is the most involved and usually takes the longest: developmental editing. I like to think of this as a "big picture" edit that looks at the overarching themes and story. Sometimes this means rearranging chapters and paragraphs so that the book flows better. Or, it could mean that there's a lack of description with character or setting, or that the pacing of the book needs some help (some sections move too quickly while others are too slow). Often, developmental editors will also include line and/or copy edits in later rounds or iterations of their edits, but their main goal is making the book as solid as it can be. If your characters or setting are unbelievable or your dialogue doesn't make sense, no one will care about an errant spelling mistake or comma splice. Author coaching and developmental editing are similar, but not exactly the same. Take a look at my post on Author Coaching to understand the difference.
Technical editing is another type of edit, though this can fall under a few categories and have it's own sub-types. Things like industry-specific edits are often labeled "technical." If you're writing for a medical journal or a book on accounting, you're going to want someone who is well-versed in your field to make those types of edits. Virtually anyone can copy edit something like that, but unless they're familiar with that field, they may miss something critical. Technical editors often charge a bit more because of the field specificity and experience they have.
No matter the editor you use, most of them will also keep an eye out for liability issues for you. While we're not attorneys, we can point out red flags. Some editors will also include fact-checking and cross-referencing (think quotes that need to be accurate or citations/bibliography that needs checking), but some offer this as an additional service. If you require an Index for your book, you'll want to hire someone who specializes in Indexing. There are a few editors that may be able to handle a small index, but this is a specific skillset that most editors don't possess. Check out the American Society for Indexing should you require this for your manuscript. And be sure that no matter the type of editor you're using, they are following a style guide of some sort. Chicago Manual of Style is the guide of choice for book publishing, but if you're having a journal or other technical manuscript edited, they should follow whatever style guide you specify. (Look for an upcoming post on how to spot bad editors.)
As a last note, please know that even with professional editing, there is still a margin of error of 3-5% in any professionally edited book. We're human, and while we don't intend to (because most of us are perfectionists) the odd spelling error or punctuation snafu slips by. The beauty of digital print, though, is that those errors can often be fixed quickly and without too much hassle. If you'd like more in-depth information about this topic, please take a listen to my podcast and subscribe on your favorite podcast app.
P.S. Looking for an editor? Submit your information here (scroll down to the Get in Touch section) and I'll do a free editorial sample for you of the first 5 pages. I'm also a member of the International Association of Professional Writers and Editors (IAPWE) where you can post jobs looking for editors for your project.