How do I identify and repair this drywall damage?
I ran into a very similar scenario, where upon removing the base trim, a portion of the paint began to peel. I think the original paint was applied directly to the drywall with no primer, though I may be mistaken. What resulted was the paper layers that surround the gypsum of the drywall began to peel off with the paint.

A / B) You can see where the layers of paper separated from the gypsum core from removing the nails holding the molding
C) A section of paint that was stuck to the molding took one or more layers of the paper off exposing a brown inner layer of paper.
This actually occurred second to a different wall where I had removed the hanging cabinets (Water leaking from the bathroom above ruined the ceiling, and I removed the cabinets to investigate the extend of the damage through the wall). On removing these, there was a noticeable exposure from where the cabinets had been painted around. Removing the paint took most every layer of paper off, completely exposing the white gypsum core of the drywall. There were also sections that still had some of the brown paper on the outside of the drywall. I attempted to use a primer/sealer on this, but the result was that the paper absorbed the moisture and looked very bad. The final solution was to rip out all of the existing drywall and replace it.
It was a learning experience for me (first time home owner) in having to replace that wall, but the final result was very good.
The base molding removed on a separate wall of the same room (pictured above) appeared to have the same issue, where the paint sealed it to the cabinetry. On removing the cabinets I had to be careful about being delicate to not peel much of the drywall paper off. There were a couple areas that I was not able to avoid, and my solution was to try applying a very very thin coat of joint compound, allowing it to dry, and repeating the process as needed until the wall was evenly coated. From there I painted with a primer/sealer before applying the final coat of paint.
It was certainly not perfect, as indicated in the 2nd picture, but I know this area will be covered by cabinetry so I was willing to let it slide.