The play is only loosely based on history. There was an event that sparked the play idea in Shakespeare’s head. Fleance might have had brothers. The witches said that Banquo's sons would be king. However, we don't know how many he had. Perhaps there were other sons besides Fleance. Basically, the witches still stick to their guns on this one because they show Macbeth a glass with images of reflections of Banquo.
Thou are too like the spirit of Banquo. Down!(125)
Thy crown does sear mine eyeballs. And thy hair,
Thou other gold-bound brow, is like the first.
A third is like the former. (Act 5, Scene 1, p. 61)
Maybe Malcolm was only on the throne a little while? It is possible that after he died, one of his sons might have become king because Donalbain and Malcmolm had no sons. Personally, I would not trust Donalbain to rule any kingdom, and Malcolm was young and unmarried.
This is one of the historical inaccuracies of the play. In real Scottish history, Banquo and Fleance didn't exist; they aren't real people. The crowning of Malcolm to end this play was to appease Shakespeare's most important audience member, King James I. King James was a direct descendent of the real Malcolm from the play. In fact, the reference about the long line of kings would have been in direct relation to King James himself.
So why include Banquo and Fleance? Because the events of this play never actually happened. The real King Duncan was killed in battle, as was the real King Macbeth, and there was never an assassination attempt on Duncan (at least not by Macbeth). At this time, historically, successors were named, not passed down. The real Malcolm was bitter about his father interceding the line with Macbeth (he probably didn't have much of a choice though because of Macbeth's elevated status with the Scottish elders). At any rate, after Malcolm (and later his brother Donald the Bane) because kings, they started slowly changing the history behind Macbeth's kingship. By the time King James was in power, Macbeth had become a traitor to the throne. While Shakespeare still took some liberties in turning Macbeth into a heartless killing monster, it would have been a characterization that appeased King James...and since King James was writing the checks, it was a good picture to paint!