Henry VI remained childless for much of his reign and this inevitably sparked questions about the succession, always a divisive and potentially dangerous subject in the political arena.
It is often forgotten that for a long time the clear heir was the King's uncle, Humphrey, Duke of Gloucester, who was himself childless as far as legitimate issue is concerned. (His son and daughter, Arthur and Antigone, are sometimes said to have been born to Eleanor Cobham before he married her, but the chronology makes this improbable.) Gloucester was very much a representative of the war party and his alienation from Henry's governing clique was to lead to his downfall, and very probably his death. (People at the time seem to have thought he had been murdered, but he may simply have had a heart attack or similar event under the shock of being arrested.)
Henry IV's succession statute did not give any directions beyond Henry VI and Humphrey, so after these two it was legally speaking all up for grabs.
The Duke of York had a two-fold claim. One was descent from Lionel of Clarence, via the Mortimers, in the female line. The snag was that this hereditary claim was (at least arguably) superior to that of Henry VI. The last Earl of March had come under deep suspicion without even pressing a claim, so it was potentially dangerous. His secondary claim, via Edmund of Langley, was arguably inferior to a number of Lancastrian claimants.
The Beaufort dukes of Somerset were heir male to John of Gaunt, but as is well known they descended from a line that was born illegitimate, then legitimised. Henry IV had gone to the trouble of specifically excluding them from the succession though whether he had the legal right to do so is arguable. It was not unreasonable for the Beauforts to see themselves as potential heirs to Gaunt, though they were not blood heirs to the duchy of Lancaster itself, which had come from Blanche of Lancaster, not Katherine Swynford.
Setting aside foreign claims (because the kings of Portugal and Castile, among others, had some Lancastrian blood in them) the other senior Lancastrian claimant was Henry Holland, Duke of Exeter, who descended from Gaunt's daughter, Elizabeth of Lancaster. He certainly had a better claim to the duchy of Lancaster than did the Beauforts, and an arguable claim to the throne itself. Holland was, however, a deeply flawed individual, out there on the edge of reason, and even Lancastrian governments were wary of him. Ironically, he was the Duke of York's ward, and first son-in-law. This connection did not bind them at all - if anything it sharpened their mutual hostility.