The story of King Lear and his three daughters existed in some form up to four centuries before Shakespeare recorded his vision. Lear was a British King who reigned before the birth of Christ, allowing Shakespeare to place his play in a Pagan setting. Predated by references in British mythology to Lyr or Ler, Geoffrey of Monmouth recorded a story of King Lear and his daughters in his Historia Regum Britanniae of 1137. Dozens of versions of the play were then written up, highlighting certain events, such as the love test, or expanding upon the story, such as creating a sequel where Cordelia committed suicide. Most of these versions had a happy ending, though untrue to the story, where peace was restored under the reign of Lear and Cordelia. Shakespeare however had no interest in writing a tragicomedy.
The main version that Shakespeare had likely read and from which he had definitely borrowed was The True Chronicle History of King Leir and his Three Daughters. He also borrowed from Raphael Holinshed's Chronicle of England, Scotland, and Ireland (who adopted the story from Monmouth), Edmund Spencer's The Faerie Queene, Sir Philip Sidney's The Countess of Pembroke's Arcadia (from which Shakespeare drew his subplot), and John Higgins' A Mirror For Magistrates. He stole pieces and ideas from these versions to create the type of story he wanted to tell. For instance, The True Chronicle provides the basis of the story, though sentimentalizing it by ignoring the sequel. "Leir" is betrayed by two of his daughters but is reconciled to his youngest at the end. "Cordella" is accompanied by a Fool-type character who is loyal to her and Leir is reseated on the throne after beating Gonerill and Regan's armies. Moreover, Shakespeare left out main components of the earlier stories of Lear and created wholly new ones as well. Most considerable of the changes was the creation of a subplot and Lear's descent to madness.
In Shakespeare's time, numerous events, historical considerations, relationships, and cultural trends influenced his writing of King Lear. Scholars tend to believe that the play was written after Othello and before Macbeth, thus assigning it to 1604-1605. Further proof of this comes from the apparent influence the 1603 texts, A Declaration of Egregious Popishe Impostures, by Samuel Harsnett, and John Florio's translation of Montaigne's Essays, had on Shakespeare's conglomeration of the story. Critics have noted that more than one hundred words found in King Lear which Shakespeare had never before used can be found in Florio's translation. In addition, Montaigne's famous essay, "Apology for Raymond Sebonde," apparently refers to the same major themes which Shakespeare's King Lear presents. He also borrowed from a very convenient contemporary true story of a gentleman pensioner of Queen Elizabeth, Sir Brian Annesley, whose daughters tried to get him declared insane in late 1603 so that they could legally take control of his estate.The youngest daughter, named Cordell, intervened on his behalf.
As Shakespeare's players were the king's men, he knew they would have to perform for King James I and his court. Subsequently, Shakespeare imbued his plays with certain aspects that would appeal to James. For instance, the dangers of a divided kingdom was often the topic of James' speeches because of his wish to unite Scotland with England. Further topics from the time which Shakespeare took into account were the honor and wisdom endowed to the elderly as opposed to the rash ambition of the young as well as the ritualistic reverence showed to royalty. Shakespeare himself had moved into his period of writing tragedies as he felt they were more respected by critics although audiences generally preferred comedies. After his publication of Julius Caesar, he was looked at as the greatest tragedian since Sophocles and was at the zenith of his literary capacity. The play was first performed for the King in December of 1605. It was first published in a quarto in 1608 and titled M William Shak-speare His Historie, of King Lear. A completely revised version was reprinted by Shakespeare in a 1623 First Folio edition, now referred to as The Tragedy of King Lear. The two versions were conflated in the eighteenth century until editors realized how significantly different the two were and now each edition and the conflated text can be found.