There's developmental editors, freelance editors, copy editors and publisher's editors.
Developmental editors handle non-fiction projects (textbooks, etc.). A developmental editor will also work on fictional projects that require a substantial rewrite. I have done this on several projects. The time investment for the editor is significant. Care must be taken by the author due to the vast changes and suggestions. The developmental editor could become a co-author or ghost write. For one author, I reworked the first chapter several times, highlighting areas where improvements were required on each redraft. In other words, taught the skills of the trade in stages. When chapter one was acceptable, we move on to chapter two. That took fewer passes, then chapter three, etc. After the rewrite of the last chapter, she went back and rewrote the first half. Her novel had her personality, her voice. It was trapped in high-school level writing skills. After extensive edits, she had my approval to submit to agents. She was accepted by two, chose one and received a two book deal.
An editor or freelance editor will highlight weaknesses in story development, character development, and grammar. Plot holes and inconsistencies are identified. They do not rewrite. They may suggest a better word or sentence structure. They will direct the author to publications on writing when skills are lacking. The manuscript is then returned. The author may or may not act on the edits - it's their novel.
An editor working for the publisher performs the same function as the freelance editor. The difference between the two is the publisher's editor will suggest changes in a politically correct forceful manner.
A copy editor - from Wikipedia - "Copy editing (also copyediting, sometimes abbreviated ce) is the process of reviewing and correcting written material to improve accuracy, readability, and fitness for its purpose, and to ensure that it is free of error, omission, inconsistency, and repetition." In my opinion, copy editors are the final step prior to publication. Writers do hire freelance copy editors to ensure their manuscript is clean prior to submission. If you have the financing, that is fine, if not, leave that task to the publisher.
The cost to employ a developmental editor is significantly higher than that of a freelance editor. A publisher's editor is paid by the publisher.
Read up on the different types of editing before you make a commitment of your hard earned cash.