Likely originally apronunciation spelling of'n,'ne, representing final devoicing, then generalized to other forms of the article. Possibly influenced bymmh and the spelling of English nasal interjections such ashngh.
Possibly also motivated by a dispreference for single-letter words, which are not typical for German orthography (compare also the similarly proscribed merging of'n into'nen).
nh
nh
nh (upper caseNh)
nh (upper caseNh)