The good ghostwriter writes your stories, while working to stay true to your ideas and the ways you want to express them. He or she will interview you many times during the writing process. If it is a story about your life, or someone who was close to you, he may use diaries and letters that you are willing to share, and he may interview other people who were connected with your sotry, or who are specialists in their fields and who can contribute their knowledge to your story.
The Good ghostwrite will work as a collaborator with you, gathering and processing the information, until it is a coherent and interesting story. Then he writes it, sharing each draft with you, so that you can tell him what you like and want more of, and what you believe should be removed. Writing a book is a lengthy process, and the good ghostwriter takes great care all the way through, so that you will have the book you wanted when you hired him. The good ghostwriter will produce many dreafts of your manuscript, each time making it more interesting and compelling for your readers.
Once the contract has been fulfilled on both sides, the manuscript is entirely yours, and yours is the only name that will appear on it, unless you choose to include your ghostwriter's name as co-author, or place his name within the dedication. That decision is yours to make.