One topic that comes up among scientists ever so often is that of paper authorship. There are several issues here but clearly they all revolve around the underlying question of what it means to deserve a co-authorship. First, the situation.
Customs differ between areas of research
Who gets to be co-author on a publication is very different from one field of research to the other. From what I hear, in some parts of the humanities a person who has so much as one co-author on a publication invites the suspicion that they are incapable of writing without assistance, i.e. that they cannot be taken seriously. In some laboratory-centered natural sciences, papers generally have at least six and often around ten authors. My area is somewhere in the middle, with many papers having three to six but taxonomic studies often being single-authored. My own publications range from a minimum of one author to a maximum of six although a paper with eleven authors is currently in preparation.
It is also interesting to note the differences in deciding the sequence in which the authors are listed. In some fields it is strictly alphabetical. In biology, however, it is by importance. The first author is always the one who did most of the work and most of the writing, often a PhD student or postdoc. At least in my area the second most important position is the last one because it is generally assumed that it is taken by the professor or group leader; they may not have done the grunt work but they have designed the study, obtained the funding for it and supervised the work of the first author. Everybody else shares the middle, usually in order of decreasing importance of their contribution. Not everybody appears to be aware of these rules but they become important when evaluating somebody for hiring or promotion. When a committee looks over a CV, it will consider a paper on which the scientist in question is middle author as less impressive than a paper where they are first or last author.
Ridiculous number of authors on one paper
In extreme cases, a single paper may have dozens of authors - see this one as an example (I counted 45, did I get that right?). This is often justified with it presenting the culmination of a large collaborative effort. But how much can each person have contributed to the paper? I mean, one cannot put everybody on an author list who has made a technical contribution. Yes, without this machine or that sample the study would not have been possible, but let's be clear here, without the bus driver bringing professor X to work, without the cleaning staff and without the accountant managing the grant in the university administration the study would likewise not have been possible, and they don't make it onto the author list either, for good reasons.
Naively, one would expect an author of a paper to have made a significant contribution to writing; that's what the word means, after all. Not counting the reference list, the linked article for example appears to have ca 5700 words, meaning that every author would have written ca 127 words on average. But obviously nobody would be able to write a manuscript by having dozens of people contribute tiny text fragments and trying to stitch them all together. Realistically, one to three people will write a paper and the others will contribute mostly by reading and confirming that they are fine with having their name on it. The question is, does that make you an author?
Of course, one could say that scientific contributions should be acknowledged with a co-authorship, something like coming up with the study design (including writing a grant that makes the study possible if funded) and conducting the analyses. But again, they should be significant. And just like it is physically impossible for dozens of authors to make a significant contribution to the same manuscript it is also physically impossible for dozens of researchers to make practiacl contributions to the same study that all deserve the label "significant".
Ridiculous number of papers by one author
The flip side of this is that there are some scientists who have immense numbers of papers to their name. Recently I heard colleagues speak of one who had published 50 papers in one year; much shaking of heads and much frowning was involved. Imagine what that means, on the face of it: this person would have had to design, conduct and write up one scientific study per week. That is plainly impossible. The only reasonable conclusion is that they did not deserve all or even only most of their 50 authorships.
And indeed there are fields where it appears to be quite usual and accepted that the head of a big research group who may have many technicians, postdocs and students working for them is made last author of every paper that anybody in their department produces. Even if they have never read the manuscript and would not understand what it is about if they did. That is, of course, not only problematic from an ethical standpoint but also quite risky. What if the group contains a very ambitious postdoc who manipulates the data to make the results more impressive? The group leader would never realize that something is odd because they don't have the time to really read through all the papers that their name automatically appears on. But when the fraud is eventually discovered it will still hurt their reputation, to say the least.
My own opinion
Realistically, there will be cases where one has to offer an authorship that is technically not all that deserved to make a study possible. Sometimes one needs access to crucial samples, a machine or funds and the price for that is a co-authorship even if the collaborator is too unqualified or lazy to contribute significantly to study design or manuscript writing. That is somewhat problematic but one has to be realistic.
In addition to that, I feel that technicians should be made co-authors if they have done a lot of the lab work, i.e. more than providing a bit of assistance or one step of the work pipeline. It also seems only fair that students who did most of the work in a project should get a co-authorship even if the supervisor is not technically obligated to offer it to them, as was the case in German Diplomarbeiten when I was a student. In that sense I would expand the author list to potentially include everybody who has made a significant contribution to study design, data collection, analysis or manuscript writing.
And I feel that pretty much by definition no average-sized research paper can have more than ca. twelve people making a significant contribution. There may well be more contributors but their contributions cannot have been significant without making a mockery of that term. And that is what acknowledgements sections are for.
The next step is that one needs to offer everybody on that potential list the chance to participate in writing the paper, even if it is just through the contribution of a paragraph in the methods section or proof-reading and commenting on the draft manuscript before submission. This is important: they have to be given the possibility to participate in writing! One of the most disgusting spectacles in science are colleagues who secretly finish the manuscript all by themselves and then justify not giving a crucial collaborator a co-authorship with the observation that that person did not help with the writing. Well duh, of course they didn't, because you did not let them. This has not happened to me but it has happened in another research group in the university where I did my Ph.D., and no, I don't understand that behavior either.
And here is the thing: No matter how large or crucial their contribution, nobody should be an author if they haven't thoroughly read and understood the paper and commented on it. Everybody who wants to be a co-author needs to understand what they are signing with their good name.