Why write papers anonymously?
I searched for the author Anonymous in PubMed (the life sciences publication database), and found 26 results, which shed some light on your question.

Some paper titles:


"I was sexually harassed as a junior by senior doctors: it still goes
on, and it needs to stop"
"My own story: dealing with depression"
"A mind surrounded by a moat: a first-person account of cognitive impairment in multiple sclerosis"
"Trying to overcome racism in the NHS"


So in many cases the authors are describing a sensitive experience or medical condition they have and they do not want others to know about. Alternatively the author could be a whistle-blower. It may also be used in some cases where the editor wrote the piece but does not take credit, but I am guessing this is usually not the case.