He was the King of the Men of the Mountains, and when the Realms in Exile were founded, he met Isildur at Erech and swore his affiliation to Gondor on behalf of his people.
Then the time came when their former lord, Sauron arose again, and Isildur summoned them, but the Men of the Mountains were unwilling to turn against Sauron as they worshipped him during the Dark Years. Isildur cursed them for not fulfilling their oath, that there will be no other King after him, and they will never find rest until someone else calls for them.
His people dwindled and in the following centuries, the wraith of the King of the Dead was a terrifying rumour for the Men of Gondor south of the Mountains.
During the War of the Ring, Aragorn came to the Paths of the Dead as the Heir of Isildur and offered them a way to redeem themselves. On their way to Erech, people were scared of the news that the King of the Dead was out again, and defenders and foes alike fled away.
The Oathbreakers followed the Grey Company to Pelargir where they drove off the enemy. Having fulfilled their oath, the King of the Dead broke and threw down his spear, bowed to Aragorn and turned away, as the Shadow Host vanished