Why did "it" lose its initial 'h' but other pronouns such as "him" and "her" didn't?
The pronouns it, him, her had an initial h in the older forms of English which has been retained in her, him, but lost in it (formerly hit).
Etymology of it (Wikitionary):
From Middle English it, hit ( > dialectal English hit (“it”)), from Old English hit (“it”), from Proto-Germanic *hit
The word it had an initial h in both spelling & pronunciation but was then lost in Middle English onwards. Other pronouns such as him, her had also an initial h in Middle & Old English but has been retained.
Was this an irregular change or is there any explanation for the loss of initial h in that particular word?
According to the following source, the h was lost because of its unemphasized position:
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 heard only "in the careful speech of the partially educated" [Weekley, Ernest, An Etymological Dictionary of Modern English]
(Etymonline)