Some of the history surrounding the succession of English kings can make your head spin. In Act 1, Henry IV is still thinking about a crusade to help alleviate some of his guilt in usurping the throne, and to help unite the English people against a common enemy. But these hopes are dashed right away as the King receives reports of unrest in his kingdom. Most notably, Westmoreland tells the King, Edmund Mortimer has been captured by the Welsh.
. . . the noble Mortimer
Leading the men of Herefordshire to fight
Against the irregular and wild Glendower,
Was by rude hands of that Welshman taken,
A thousand of his people butchered
But the King is disinclined to pay for Edmund Mortimer's ransom. Why? We are told that Mortimer was mentioned by the dying deposed Richard II as the rightful heir to the throne, ahead of Henry IV.
Looking at the geneology is pretty complicated. But, briefly, you have to look back to the reign of Edward III who was king of England from 1327 to his death in 1377, and who had seven sons. Richard II was the son of Edward III's first son (Edward the Black Prince), so very much a rightful king. After the death of Richard II, the rightful heir to the throne would come from the line of Edward III's second son, and, failing that, the line of the third son, etc.
In fact, Edmund Mortimer was the son of the third son. So rightfully he was next in line for the throne.
However, in fact there were two Edmund Mortimers, and the Edmund Mortimer who was captured by the Welsh was not the son of the third son. He was actually an uncle of the 5th Earl of March, at best third in line to the throne. (It actually doesn't make sense that a man who has a legitimate claim to the throne would be given an army to fight for the King anyway.)
It turns out that Holinshed, an English chronicler, made a mistake with the two Edmunds. And since Shakespeare was using Holinshed, he made the same mistake.
Ahh, but it doesn't really matter. We know Shakespeare's history isn't very accurate. You don't read the Bard for a history lesson, we read it for the drama.
NOTE: All this is from Isaac Asimov's "Guide To Shakespeare."