neuter possessive pronoun; the modern word begins to appear in writing at the end of 16c., from it + genitive/possessive ending 's (q.v.), and "at 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. Also, from c.1300, simple it was used as a neuter possessive pronoun. But in literary use, his as a neuter pronoun continued into the 17c.
Old English hit, neuter nominative and accusative of third person singular pronoun, from Proto-Germanic demonstrative base *khi- (cf. Old Frisian hit, Dutch het, Gothic hita "it"), from PIE *ko- "this" (see he). Used in place of any neuter noun, hence, as gender faded in Middle English, it took on the meaning "thing or animal spoken about before."
The h- was lost due to being in an unemphasized position, as in modern speech the h- in "give it to him," "ask her," "is only heard in the careful speech of the partially educated" [Weekley]. It "the sex act" is from 1610s; meaning "sex appeal (especially in a woman)" first attested 1904 in works of Rudyard Kipling, popularized 1927 as title of a book by Elinor Glyn, and by application of It Girl to silent-film star Clara Bow (1905-1965). In children's games, meaning "the one who must tag the others" is attested from 1842.
: Clara Bow, the original it girl