A distinguished and influential mathematician whom I'll call Y sat next to me in the computer room at a mathematics research institute one evening. Y was having trouble with a word processing program, and asked me for help. I happily obliged.
When I realized he was writing a letter of recommendation, I looked away, assuming it was confidential. This made it harder for me to help him. Possibly just as a way to let me know that it was OK to look and to continue helping him, Y asked me for advice on the letter.
So I read it. The gist was something like "Susie is a lovely person. It was a pleasure having her in my class." Nothing about how well she did in the class.
I asked some questions, and learned that Susie was an undergrad applying to professional schools. I asked Y how Susie did in his class; what sort of grades did she get on the exams and homework? He told me that she got the highest or second highest grade on each of the exams and homeworks, giving her the highest total score in the class. I gently asked what he thought about including that information in the letter. He asked if I thought that was a good idea. I replied, "Yes".
I've had other similar experiences over the years. My experiences are consistent with studies that conclude that letters of recommendation about men are written differently than those about equivalent women. The ones about women talk more about her personal life, while the ones about men include more relevant adjectives and information, and fewer "doubt raisers".
My experiences are also consistent with studies that conclude that people read letters about men and women differently, and perceive equivalent letters to be stronger when the subject is male than when the subject is female.
See for example https://www.cerias.purdue.edu/site/images/uploads/Discrimination_gender_memo_07-12.pdf and the references therein.