In a disproportionate amount of fiction works, the protagonist turns out to be a writer. The explanation is that the end products are created by writers, who put themselves into their works. And when you write what you know, a writer tends to write about writing. In other words, it’s selection bias.
According to tvtropes, this phenomenon is called “most writers are writers,” and writing about writers has several advantages in providing realistic excuses for (un-)realistic diction, investigative skills, journalistic connections, short work weeks, and arbitrary research knowledge that you characters need to have. The same applies for screenwriters about the film industry, and so forth.
TVTropes also contains the following addition:
“A consequence of this is that there is a disproportionate number of works involving the difficulties associated with getting a job after college when you have an English major, even if it’s a good economy, as all the writers were English majors, and virtually none of them could find a job after college, even in a good economy.”
Of course, Most Writers Are Writers does not entail that all writers are writers, only that a disproportionately large number of them are. According to the Bureau of Labor statistics, the number of writers and authors in 2012 was 129,100, or 0.04% of the US population. A different site estimates the low end at 250,000, or 0.08% of the population. In either case, clearly a much larger percent of books written include writers as main characters.
The downside of Most Writers are Writers is that other people are underrepresented. To be sure, there are books and screenplays written about anything possibly imaginable. But the subfields are much smaller, and are often much less accurate because of this selection bias.
For instance, scientific terms and concepts are used incorrectly all the time in the subfield of science fiction, where authors are supposed to have a higher-than-average understanding of science in the first place. We excuse sci-fi authors for making technical mistakes because they’re writers, not scientists (exceptions exist). On the other hand, when’s the last time you recall a blatant mistake written about the writing process or a book deal? Never, because someone writing about these will be knowledgeable of them.
But that is about writers’ interests and their knowledge of science. The Most Writers Are Writers trope is different in that it concerns the characters themselves: it’s very rare for a main character to actually be a scientist. And when they are, they’re often beyond terrible at their job, itself a bias, but that’s for a different time…