After reading about paper mills, and knowing that there are companies that offer ghostwriting for bachelor theses, at least in Switzerland and Germany, I asked myself if there are methods to detect ghostwriting. While this kind of service may be acceptable in some domains, in academia, having a ghostwriter may violate principles of scientific integrity. Unlike plagiarism, however, it seems to be much more difficult to find out if someone has a ghostwriter. Nevertheless, is there evidence that would point to it? I can only think of metadata of manuscripts (in case the ghostwriter forgot to clear his traces). I've certainly had students in the past who surprised me with their research paper because it didn't match my impression at all, but of course that's not really an indication.
The utility of this answer depends on why you are seeking this information, but this comes from my own experience.
As a student, I was asked to help jog the memory of a researcher on some topics they had been working on in a collaborative project. This involved reading the papers of the collaborators, summarizing them, and figuring out how they all worked together. I wrote this all into one document, emphasized that they were notes only (not polished in any way), and did not give permission to use my work other than its intended use. I later found that the researcher published my work verbatim and claimed it as their own. After raising this issue as far as I could, I found that I was called a "ghostwriter" against my will.
Based on this experience, here are a few remarks:
- When talking to them, the researcher could not explain the works in any sort of detail other than what I had given them for notes (it had been a while since they had worked on the topic).
- Some members of the institution are aware that the researcher did not write their own work because I spoke up. This was formally documented.
- As you noted in the question, metadata revealed that I had written large portions of the document rather than the researcher.
- My writing style and the researcher's writing style differed considerably (they are not a native English speaker). If you were familiar with their work at all, mine would have stuck out like a sore thumb. Stylometry tools could have been used as well.
If you were looking to detect ghostwriters in students, you could employ a few strategies to help figure it out:
- Give them an oral component to explain their answers in more detail.
- Ask them to submit assignments electronically to have a paper trail.
- Have them submit smaller assignments to reveal their writing style. This would not work if they had a ghostwriter for every assignment.