A tale of possessives
One of my pet peeves when reading English texts is that people sometimes use "it's" (which has two meanings, "it is" or "it has") in place of its (which is the possessive pronoun of the 3rd person for the neutral gender)
How did we get there, and why do people confuse it? This is what I could gather from a bit of research and generally being a language nerd.
What does it mean actually when you say "This is Peter's car"? "Peter's car" in this case is what is called the Genitive Case, and it's something that happens in several languages, for example, Latin and German (though it works in a more complicated way, English simplified it). And in most languages this happens by adding a suffix to the word.
So Latin has millions of ending each one depending on the type of word, gender and case but it has the practical effect that the word order is less significant than in English.
In Latin, for example, "Agnus Dei" means (The Lamb) (God's). The 'i' in Dei is the Genitive case, the Nominative case would have an 'us' ending (Deus). I'm not a Latin specialist so this might be off a bit
In German, which has similar origins as English, the phrase is: Lamm Gottes. You see that Gottes is very similar to English. The German word is Gott and it gets the "er" ending (or just r) to indicate the Genitive case (for masculine words).
So up until now, there's no apostrophes showing up right? Right
And the pronouns throughout English history never had an apostrophe.
It actually came from French (and Latin). To indicate vowels that would end up not being spoken in the end. (Remember, there are several things that influence how languages evolve. In several cases it involves "laziness", people being stupid and words being hard to pronounce.)
So if they had something like La Heure (The Hour), they would not say [la œʁ] they would say it [lœʁ] because they have better things to do so they would write it simply L'Heure (Just pretend the h is not there, it's not pronounced). Other languages like Portuguese adopt it in phrases like Copo D'Água (A glass of water)
Then, at this point, people writing English started using it to indicate that something was missing (which usually wouldn't be said). It is hard to say "It is", people just simplified it to saying "It's", so hence it became that.
Now with the Genitive case above there seems to be some discussion to what is really being elided. Some people believe that the German ending "es" was kept but the "e" was not pronounced anymore. Others believe that what's being hidden is something called the His genitive where the phrase would go "James his park" (this would have happened in Early Modern English — Shakespeare's time, also could be written "is" or "ys" apparently). Example
Funnily enough, the possessive pronoun for neutral singular in EME could be either "his" or "it". Example (5th verse)
So, coming to modern times, for some reason people on the internet though that you would apply the same genitive rule to pronouns to indicate that it is a personal pronoun when this was never the case! (The fact that it's homophonous to "its" certainly doesn't help)
In summary, if you can replace what you wrote by "It is" or "It has" then by all means put "it's" there. On the other hand, if you could put "his" there, but it's a thing instead of a person, use "its".