Not having seen this series I don't know if this was even mentioned but actually, the Beauforts had a very weak claim to the throne since they were illegitimately descended from John of Gaunt and his mistress Katherine Swynford. They were later legitimized but barred from succeeding to the throne. The York line, even though descended from the younger son of Edward III, was a legitimate branch of the Plantagenets and had better succession rights. Henry Tudor capitalized on Richard III's unpopularity and pressed his Lancastrian claim to the throne, weak as it was. He had to marry Elizabeth of York afterward since she was the rightful Yorkist heiress and this would further solidify his hold, even though he claimed right of conquest rather than succession. He had to constantly protect his throne during his reign from Plantagenet claimants posing as the Duke of York (the younger prince in the tower) and Edward of Warwick ( Edward IV's nephew) who, if they were genuinely those people, would have had better right as king than he.
This seems to be a generally held view, but it's not entirely accurate. While Richard, 3rd Duke of York's paternal grandfather was one of Edward III's youngest sons, Edmund of Langley, 1st Duke of York, his claim to the throne came through his mother. She was the daughter of Roger Mortimer, 4th Earl of March, whose mother was the only child of Lionel of Antwerp, 1st Duke of Clarence.
Lionel was Edward III's second surviving son - after Edward, the Black Prince (father of Richard II), and before John of Gaunt, father of the Lancasters and Beauforts. John's eldest son, Henry, usurped the throne from his cousin. The Yorks essentially tried to take the throne on the grounds that since it was their ancestor who had been the heir presumptive they were entitled to the throne and not the Lancasters (who of course had a superior claim through conquest).
Henry Tudor's claim is tricky for a number of reasons. While the Beauforts were born illegitimate they were subsequently legitimized twice - the first time with no mention of their ability to inherit. The second time they were bares from being able to inherit because it was a Lancaster legitimizing them - Henry IV didn't want his half brothers to succeed over his sisters' sons.
However, by the time of Henry VI, the Lancaster line had dwindled a lot. A lot of the male line was dead and the various female lines had married into foreign royal houses. Having someone like John of Portugal as a heir presumptive wasn't exactly a desirable option in the best of circumstances, but especially so when other people are trying to take your throne. As such, according to David Starkey, Margaret Beaufort's marriage to Edmund Tudor was arranged by Henry VI with the intention that resulting sons could be heirs if necessary.