neuter possessive pronoun; late 16c., from it + genitive/possessive ending 's (q.v.). "[A]t first commonly written it's, a spelling retained by some to the beginning of the 19c." [OED]. The apostrophe came to be omitted, perhaps because it's already was established as a contraction of it is, or by general habit of omitting apostrophes in personal pronouns (hers, yours, theirs, etc.).
The neuter genitive pronoun in Middle English was his, but the clash between grammatical gender and sexual gender, or else the application of the word to both human and non-human subjects, evidently made users uncomfortable. Restriction of his to the masculine and avoidance of it as a neuter pronoun is evidenced in Middle English, and of it and thereof (as in KJV) were used for the neuter possessive. In literary use, his as a neuter pronoun continued into the 17c. In Middle English, simple it sometimes was used as a neuter possessive pronoun (c. 1300).