This character is harsh and mean. They are abrasive and cruel, but in truth they're just depressed and fearful, trying to intimidate people into leaving them alone. Like a hedgehog, this character bristles with spikes in order to protect themselves. Intimacy scares them, and perhaps they've been hurt before.
This is a common method of creating a Jerkass Woobie. By being introduced as a jerk whom the audience hates, only for character development to reveal that in reality, they're just scared of getting close to anyone.
Often overlaps with the Broken Bird who has similar feelings of depression, isolation, and fear of social interaction due to a Dark and Troubled Past. Broken Birds, however, tend to be passive, while this character is proactive about driving people away. May cultivate and revel in their jerkass reputation. If their hidden persona is discovered it is possible they might react with Don't You Dare Pity Me!
Compare with Tsundere, a character who acts harsh and abrasive to conceal a sweet or loving side; and with Jerk with a Heart of Gold, where the character is mean and insufferable (with occasional gentler moments) but doesn't necessarily act like that because of a Freudian Excuse. The Stepford Snarker is somewhat similar, hiding their sadness and insecurities under snarkiness, but is not necessarily such a Jerkass about it. Being Sour Outside, Sad Inside is a fairly common trait of the Mentor in Sour Armor. In anime fandoms, this character is referred to as a tsunshun.
In Real Life, frequent swings between angry/aggressive reactions and anxious/depressive ones are a hallmark of Borderline Personality Disorder. Pushing others away is also a common coping mechanism for people with Complex Post-Traumatic Stress Disorder. Therefore, Truth in Television.
A lighter version is an Easily Embarrassed Youngster who hides and/or expresses their embarrassment through rudeness.
Compare Knight in Sour Armor.