The copy editor tidies up your writing at the detailed level. That sounds reasonable - they spot and correct the typing and grammatical errors, make sure everything is consistent, and make it all flow nicely. Sometimes it is reasonable, but sometimes the text becomes a battleground.
A good copy editor preserves your style and voice and corrects any errors. Their work should be invisible. They have impeccable grammar and no ego. They improve your book, whether it is fiction or non-fiction by making many or few (often imperceptible) changes, as necessary. That is the key - necessity. They don't change things for the sake of it.
A bad copy editor rewrites for the sake of it, stamping their own voice and style on your work. Perhaps they really want to be a writer, not an editor. [Fine, copy editor - write your own book. I've written this one already.] A really bad copy editor introduces grammatical errors, and sometimes even spelling errors. Believe me, they do. You would think, given that publishing is a competitive field, that it would be hard for someone with a poor grasp of grammar to get a job as a copy editor, but it happens. Copy editors who 'correct' to 'comprised of', and who don't recognise an ethical dative if it bites them, should be sent to a special circle of Hell. Where they will be bitten by ethical datives and hanged with the hanging prepositions they are so fond of.
The copy editor needs a good general knowledge and Classical education as well as an unrivalled command of English. Writers hate copy editors who mess with things and then get them wrong. Professional writers have generally checked their work carefully; copy editors should check any corrections they want to make equally carefully.
On the whole, I am blessed with very good editors. I have had only a couple of copy editors (in around 130 books) who really botched things. One I had to have fired; there was no option. We went back to the unedited text and started again with a new copy editor. Most have improved the books, and several have spotted errors that might otherwise have got through to press. Of course, there are still errors in my books - and they are my responsibility, not the copy editor's responsibility. (It's like children - when they do well, it's their own doing; when they do badly, we blame ourselves.)
Yes, there are sometimes errors in our books; we are not infallible. But please *tell* us if you think there is an error, rather than just changing the text to what you think it should be. If I have missed out what seems to you to be a crucial reference to a prophecy of Nostradamus, that's because it's apocryphal - one of those bits that is generally supposed to be in Nostradamus but actually is not. I don't want you sticking that kind of error in my book - the kind of error I have deliberately avoided. You have joined in the webfest of Nostradamus-spotting - I've read Nostradamus in the original. Who's likely to be right? JUST ASK FIRST: sometimes you are right, and sometimes you are wrong. It is very, very difficult to spot factual errors that have been introduced into a book by a copy editor. (Grammatical and spelling errors, on the other hand, leap off the page at me - so if you want to add some errors please add that type.)
And another thing - I do know about English grammar, possibly more than you do. Writers vary in this, of course. Some are not very good at it and need lots of help from the copy editor. But you can tell, if you have a whole book to work with, whether or not someone can write correctly. If most of the book is error-free, then it behoves you to ask if you think something is wrong, or to check in one of those reference books about grammar and English usage. Or at least to flag your 'correction' so that we can argue with you about it.
If you want to argue with your copy editor, you have to know what you are doing. You need to be able to defend your original text if you don't want it changed - you must explain why it has to be as you wrote it, and why it can't be as the copy editor wants it. Why is your wording better than theirs? Don't argue for the hell of it. Look dispassionately at your text and decide whether the copy editor has, actually, improved it. All writers benefit from the work of a good editor.
Except with a picture book text, which is a slightly special case, I recommend NOT looking at your manuscript when you get the copy-edited text, except to check things you think might be wrong. If the changes don't leap out at you, they are probably fine. Don't be precious about your text, and don't be a prima donna - especially with non-fiction. A non-fiction copy editor is - in my view - allowed to edit to improve clarity. A fiction editor should be more sensitive to the writer's style, though clarity is still important. (That's even more true of poetry, but this blog is not about poets.) There's no point in being obscure just because you think it makes you look clever - it doesn't; it makes you look arrogant, up yourself or incompetent. Unless you are Jeremy Prynne.
Ideally - and usually, in my experience - the copy editor is your partner in producing a good book. And they don't even get a credit in the book. So be nice to your copy editor. Don't get cross over tiny things, and if you don't agree, correct them politely with a good, clear and measured explanation. Finally: I'd like to say a big thank you to all the wonderful copy editors I've worked with over the years - you have improved my books in little unnoticeable ways, and I am grateful for that.