The word 'his' — the masculine possessive determiner — descends from Old English 'his,' the genitive case of the masculine and neuter third-person pronoun 'he/hit,' from Proto-Germanic *hes (of him, of this), from PIE *ḱi-so (of this one), the genitive form of the demonstrative *ḱe-/*ḱi- (this, here).
The most important fact about 'his' is that it was originally the possessive for both masculine and neuter gender. In Old English, 'his' meant both 'of him' and 'of it.' 'Se cyning and his sweord' (the king and his sword) used 'his' for a masculine possessor, but 'thaet treow and his leaf' (the tree and his leaves) used 'his' for a neuter noun — with no sense of personification or metaphor. This was simply the normal genitive form for both masculine and neuter, just as German 'sein' (his/its) still serves
This dual function persisted through Middle English and into Early Modern English. Shakespeare used 'his' for neuter possessors alongside the newly emerging 'its,' and the King James Bible of 1611 does not use the word 'its' at all — every neuter possessive in the entire text is 'his' or 'thereof.' Phrases like 'if the salt have lost his savour' (Matthew 5:13) are not personifications of salt but standard seventeenth-century grammar.
The form 'its' appeared in the late sixteenth century as an analogical creation: 'his' was felt to be too strongly masculine, so speakers added the possessive '-s' to 'it,' producing 'it's' (later spelled 'its' without the apostrophe). The first known attestation of 'its' is from the 1590s. It spread gradually through the seventeenth century, becoming standard by the eighteenth. The apostrophe-free spelling 'its' (as distinct from the contraction 'it is' = 'it's') was established as a convention
The broader history of 'his' connects to the demonstrative origin of all English third-person pronouns. 'His' is etymologically 'of this one' — a genitive of a demonstrative, not a possessive of a personal pronoun. The Old English paradigm he/his/him was originally a demonstrative paradigm: 'this one / of this one / to this one.' The transformation from demonstrative to personal pronoun happened during the prehistoric Germanic period, but the genitive form 'his' preserves the structure transparently.
The Germanic cognates show parallel developments: German 'sein' (his/its) still serves for both masculine and neuter possessors. Dutch 'zijn' (his) has been supplemented by neuter-specific forms. Swedish 'hans' (his) has been separated from 'dess' (its). Each language has dealt differently with the inherited ambiguity of having one possessive form cover two genders, but English's solution — inventing an entirely new form 'its' — was the most innovative.