Mordred first shows up in writing as early as 960 AD. His name’s in the Annales Cambriae, in the entry for the year 537 AD. He may even have been a real person, though stories grew up around him later.
The story tells us that as King Arthur got older, he realized that Queen Guinevere was never going to have any children. So he would not have any sons of his own to rule after him. According to the story, Arthur began looking around for an heir to the throne. Mordred was Arthur’s nephew, the son of Arthur’s sister Morgause. So he was a good choice to rule after Arthur.
But Arthur had to go away to France to fight Emperor Lucius of Rome (possibly originally Glycerius, who was a real emperor in 473 AD). While he was away, Mordred married Guinevere and took power for himself. King Arthur came back to fight for his throne, and Arthur and Mordred met at the Battle of Camlann. But Arthur was badly wounded, and Mordred was killed. Morgaine and Nimue took Arthur off to Avalon to heal him, but that was the end of Camelot. Someday, though, the story says, Arthur will come back and everything will be good again.
(Compare this story to the older Parthian story of Vis and Ramin).