Question about possessive words

I have a question about possessive words.

Consider the following examples:

  1. Sarah has a hat.
  2. This is Sarah’s hat.
  3. This is her hat. (“her” referring to Sarah)
  4. This is hers. (“hers” referring to the hat being Sarah’s hat)

My question is how to think about stuff like “Sarah’s” in example
2 and “her” in example 3. Here are my numbered comments on the above
examples:

  1. “Sarah” is clearly a noun in the first example.
  2. “Sarah’s” is the possessive form of “Sarah.” So by adding
    the apostrophe + s to “Sarah”, have we changed the part of speech of
    the word “Sarah”? Is “Sarah’s” a modifier now? Or is it kind
    of like a verbal, where Sarah is derived from a noun and can still be
    thought of as being a noun, but can take on roles other than strictly
    noun roles? (A noun-al?) I think talking about the possessive form of a
    noun as still basically being a noun is standard.
  3. “her” seems to be modifying “hat.” But if “Sarah’s” is
    a “noun”, then “her” seems like a pronoun. In school, I learned
    words like “her” in example 3 as being “possessive adjectives”,
    and they are typically treated as adjectives in contexts like example 3.
    But I found a page saying possessive adjectives are technically pronouns
    cuz they replace a noun, and that made some sense to me.
    www.grammar-monster.com/glossary/possessive_adjectives.htm
    It seems like if a word is replacing another word that we’re calling a
    noun, then the word being used as the replacement is a pronoun. And if a
    word is replacing another word that we’re calling an adjective, then
    the word being used as a replacement is a pro-adjective or something.
    And maybe nouns can do the adjective job sometimes, and maybe so can
    pronouns, but saying that nouns can do adjective jobs sometimes seems
    different than saying a particular word is actually just an adjective.
    So I am wondering if there is a contradiction between viewing
    “Sarah’s” as a noun in example 2 and “her” as an adjective in
    example 3 based on the argument that “her” is a pronoun, not an
    adjective.
  4. I think “hers” stands for something like “her hat.” So maybe
    it’s really like a pro-noun-phrase. I’m okay with calling it a
    pronoun though. It is in fact standing for a noun, I think. It just
    might be standing for other stuff too.

BTW it’s possible that I’m paying too much attention to categories
and labels and that there is a better way to think about all this stuff.
That would not surprise me in the least. But if that’s the case then
there is a better way to understand this topic that I don’t quite
understand yet, so it still seems worth asking the question!