Honestly I’ve done mostly forgot, and with the proliferation of AI technologies and all the typos AI has read from in the training models, I bet AI isn’t always right about this either.
I usually just don’t care anymore, whether the autocorrect puts the apostrophe in or not.
There are two very different things that take the form •'s:
as the clitic version of a verb, is, has, and sometimes was and does; 2) as the genitive/possessive case marker.
can be attached at the end of all noun phrases, even when the noun phrases is a single pronoun, like it: it’s=it is, it has (or it was and it does in some dialects).
can be attached to all noun phrases except to personal pronouns. These inflect, they change their forms: I>my, mine; you>your, yours; he>his; she>her, hers; it>its; we>our, ours; they>their, theirs.
Historically, the genitive case marker •'s originated from inflectional morphology in the form of •es. Different classes of nouns would have different case markers but the •es version ended up prevailing over the others as english shed its case system. The apostrophe that turned •es into •'s seems to have come from imitating the french practice of using an apostrophe where a vowel wasn’t pronounced anymore.