system
Given the following post, respond as if you're commenting on Reddit:
human
[LOTR] Why did Aragorn, who was only very distantly related to the former kings of Gondor have a better claim over Gonder than the Stewards who had ruled the country pretty well for like 25 generations?

Doesn't ruling Gondor for such a long time give the stewards some legitimacy? Besides I'm pretty sure the lines of Gondor and Arnor split over 3000 years prior to the beginning of the events of the book. Even taking into account the Numenorean longevity, they're still pretty distant aren't they?

On a side note: why didn't the Dudenain go claim Gondor immediately when the Witch King trashed Arnor, instead of choosing to wait for so long before making their move?
gpt
Back when they were two realms under one king, it became something of a tradition that the High King directly rule Arnor and appoint a relative to manage Gondor. Elendil did it with his son Isildur and Isildur did it with his nephew Meneldil, as Isildur's brother, Anarion, was dead and his own sons were too young.

When Isildur died, his son Valandil became King of Arnor, but did not claim the title (either in name or in practice) of High King of Arnor and Gondor and Meneldil continued to rule Gondor. When Meneldil died, rulership of Gondor passed to his son Cemendur without contest from Valandil. This essentially broke the kingdoms in two, with the line of Isildur ruling over Arnor and the line of Anarion ruling over Gondor.

There was an attempt to repair this break after the death of Ondoher (king of Gondor) and all of his sons. Arvedui (from Isildur's line) attempted to restore the position of High King. His arguments were:

1. He was a direct descendent of Isildur and the position of High King was never formally abolished.
2. His wife was Ondoher's daughter and therefore she was heir to Gondor anyway.

The Steward and Council of Gondor rejected the claim and gave the crown to Earnil, another descendent of Anarion. This basically was a formal rejection of any claim of the line of Isildur to the crown of Gondor. There was little Arvedui could do, as his own kingdom (now the kingdom of Arthedain, a fractionof Arnor) was dwindling (he would indeed be the last King before the creation of the Dunedain).

This strictness, however, would backfire when King Eanur would die, the last living descendent of Anarion. With no other heirs, the Stewards could hardly claim the throne after thousands of years of saying that only descendants of Anarion could do so.

So the Dunedain attempting to claim the throne and reunite the Kingdoms would be tricky, given this history. The reason why it was Aragorn was basically because every thing happened right for him:

1. The ruling Steward, Denathor died, and his "heir", Faramir was in a coma.
2. He fulfilled a prophecy only the heir of Isildur could fulfill.
3. He was pivotal in helping prevent Gondor from being overwhelmed by the enemy.
4. He displayed healing prowess associated with Kings in Gondorian culture.

Even then, he basically waited for them to choose him, rather than assert any claim. He allowed Gondor to be ruled by a noble council until settling the small matter with Sauron.

So basically he proved himself militarily, politically, and socially, and anyone that might oppose his crowning was dead, leaving only people whom he personally lead to victory or saved the life of.