This will vary by publisher, but you can expect some or all of this to happen:
- they will give you their word template (or equivalent) so you can tag/style paragraphs and the like according to their process (eg a style for code, for figure captions, for a pull quote, for a bulleted list, and so on)
- they will tell you the series style rules (eg you can't have two solid pages of text, break it up with a figure or bulleted list, every chapter should have a pull quote, code under x lines should be inline and code over x lines should be a Listing and handled like a figure, and more)
- they will tell you whether there are headings and subheadings and how to format them, whether there are chapter length requirements, questions at the end of chapters, how to handle footnotes, citations, links, references, and all of that.
You will then apply all of that to the text you have written. You may need to add figures, lengthen or shorten a chapter, come up with exercises and review questions, or otherwise make fairly large structural changes. What you thought was "Written" might not have been. Had you and the publisher teamed up before writing started, you would have written it in the first place with this structure in mind.
It's reasonably common for authors to ask friends and colleagues to review text for completeness, are the examples good, do the diagrams make sense, and the like. If you plan to do this, now is the time: if you know you need to lengthen chapter 3 and shorten chapter 7, or that you need more diagrams throughout, you can ask your reviewers to help with pointing out opportunities to do those things. You don't want the steps after this to be done on text that isn't complete, or that is going to be majorly rewritten after you hear from your peer reviewers.
Now come the post writing steps by the publisher:
- a "style editor" confirms you have enough bulleted lists or figures, you're using headings correctly, your figures have captions and so on. Here style doesn't refer to the kinds of adjectives you choose or aspects of writing style, but to the "series style" rules I mentioned above.
- a "copy editor" looks for grammar errors as well as things that are not errors at all but that this publisher doesn't accept. This could be the dreaded which/that "correction" as well as things like changing "if you want" to "if you wish" or "if you prefer" or "if you choose" because someone has decreed that textbooks use a particular phrasing.
- a "tech editor" (often someone in the same job as you who is not an employee of the publisher) confirms that your content is correct: that the dates and names are right, the screenshots do show the current version, you should click Apply on that dialog, the graphs have the right labels, and so on.
Most of the "corrections" from these three editors are actually correction requests. You may be asked to break up a wall of text with a pull quote or diagram, you may be asked to fix a which/that the copy editor says breaks a rule, you may be asked to redo a screenshot or fix a typo in some code. Some things (especially applying Word styles or fixing tiny mistakes) the person will just do. You can decline to "correct" something if you are sure it is not wrong. (This doesn't make you a temporary employee of the publisher, but it does mean you continue to work on your book for months after the first draft is complete, to help produce something that fits all their requirements while still presenting the content you intended to present.)
Also if you are unlucky at this point you will discover that these people have introduced errors into your text. I had a copy editor once who, on discovering that some code lines were too long, broke the lines with HYPHENS (which completely changes the meaning of code, being taken as minus signs) and also capitalized i in code. You must be alert to make sure that your content is still correct and still says what you want it to say.
The end is in sight! There is still an index to produce. You may be asked to tag index entries, or someone from the publisher may do it and ask you to review it (there will be spurious entries in that case, your job is to remove them.) You may put together some ancillary material for a web site (eg downloadable sample code or projects) and get the hosting arranged so the URL can be printed in the book. You also need to write "front matter" - dedications, preface, authors note, whatever. Perhaps someone "big" has agreed to write a foreword or afterword for you. Then there is cover design: depending on the series you may get no say at all or maybe be asked to choose among a few images or layouts. They may ask you for a picture of yourself to put on the cover, and a short bio.
At some point people will stop sending you files you can edit (Word, markdown, LaTex, whatever), and start sending you PDFs. Changes can still be made, but they get harder and harder and there needs to be a good reason. Now you're working on copy for their website, the Amazon listing, who should we send review copies to, and all of that.
And then finally one day a large cardboard box arrives and it's really cool. My first large cardboard box was last century, there have been dozens since, and I'm looking forward excitedly to the one that should come next week or the week after.
As for whether you should say in your cover letter that you will do what they need to get it printable, sure, it's a good idea to indicate that you know you have written (or almost written) a first draft, and that there will still be a lot more to do. Because there will. A lot.