I've been thinking a lot about this, but I've got no historical knowledge whatsoever. I've thought about asking one of my friend who is studying to be an history teacher, but whenever the subject of medieval time comes around he goes on a rant about how ''It wasn't that great! Stop!'' even when we're talking about D&D...
Where do we get our idea of this medieval fantasy world ala D&D, Game of Thrones, King Arthur,etc? And is it truly bad to have these stories like that? I know it's important to show people that living in that era would NOT have been fun, but is it so wrong to wish to live in that medieval ''fantasy''?
I'm sure the answer will be no, it's not wrong and yes it's important to know about what really was going on back then, but I'm looking for maybe an interesting discussion on the topic.
/u/PirateDuchess gave a great answer, but I'd like to deviate and suggest that it's pretty much all Tolkien. While the Victorians were interested in Medieval fantasy, Tolkien created the D&D/Game of Thrones world that we know today. He was explicitly trying to create a mythology for England, a mythos complete with an origin story to match other developed mythologies. Tolkien thought that what we would today call fantasy was unfairly denigrated (see his landmark piece On Faery Stories) and was a legitimate form of literature.
Tolkien's role as a linguist was of particular import here. Beowulf was not widely studied or appreciated until Tolkien attempted to rehabilitate the work in his Beowulf: The Monsters and the Critics lecture. Until that point, Beowulf was largely viewed through the historical lens, and translations didn't attempt to preserve the poetic form on the work. Tolkien viewed Beowulf as a brilliant piece of poetry, and modern translations have reflected his focus on the words and form of the piece.
Tolkien's career as a linguist dovetailed with his pursuits in writing to create the mythology seem in The Hobbit, The Lord of the Rings, and The Silmarillion. Modern fantasy writers openly admit Tolkien's influence in mythmaking, if not in form (George R.R. Martin refuses to develop languages in his universe, for example, since he is not a linguist). You asked about Arthur, D&D, and GoT, but the reality is that fantasy is really divided into Arthur-type legends and LotR-like legends. The latter were more consciously created, and the former were more pseudo-historical and gradually developed over centuries.
This is most likely due to the Victorians, who not only gave us the medi-fantasy thing but adopted the damsel in distress as their archetype of the passive female. It was a way of applying to a fantasy their feminine ideal. Medievalism enjoyed a huge comeback during the Victorian era.
Now as for the fantasy aspect, I would refer you to Alfred Lord Tennyson's The Lady of Shallot. There is a passage near the beginning that refers directly to the use of magic.
"There she weaves by night and day A magic web with colours gay. She has heard a whisper say, A curse is on her if she stay To look down to Camelot. She knows not what the curse may be, And so she weaveth steadily, And little other care hath she, The Lady of Shalott.
And moving thro’ a mirror clear That hangs before her all the year, Shadows of the world appear. There she sees the highway near Winding down to Camelot: There the river eddy whirls, And there the surly village-churls, And the red cloaks of market girls, Pass onward from Shalott.
Sometimes a troop of damsels glad, An abbot on an ambling pad, Sometimes a curly shepherd-lad, Or long-hair’d page in crimson clad, Goes by to tower’d Camelot; And sometimes thro’ the mirror blue The knights come riding two and two: She hath no loyal knight and true, The Lady of Shalott.
But in her web she still delights To weave the mirror’s magic sights, For often thro’ the silent nights A funeral, with plumes and lights And music, went to Camelot: Or when the moon was overhead, Came two young lovers lately wed: “I am half sick of shadows,” said The Lady of Shalott."
There was a book written by an author in 1841 named John Ruskin, The King of the Golden River in which a character similar to Tolkien's Gandalf is a large fixture.
Literature is not the only source of fantasy that we get from the Victorians. I would suggest some research into the fairy paintings of the artist Richard Dadd. He was allegedly schizophrenic but his paintings of fairies and their environments and activities were fascinating to Victorian society.
I second PirateDuchess' assertion that it is due to the Victorians, who were fascinated by the medieval period---or at least what they thought they knew about it. They idealized the period and projected their fears and hopes about their own era onto it.
In the 17th and 18th centuries (The 'Age of Enlightenment', as it is often called) the Middle Ages were seen as a barbaric period which was controlled by corrupt religious figures and institutionalized moral hypocrisy. It was roundly condemned by writers like Voltaire as a terrible period which held human progress back.
Romanticism came along towards the end of the 18th century, and was a reponse to this attitude, as well as a response to the effects of rapid industrialization and loss of rural lifestyles. It was mostly seen in various art forms---architecture, literature, visual arts, etc but also affected popular culture and scholarly writings quite a bit. The term comes from the medieval literary genre called chivalric romances, which had a wide resurgence in the late 18th century. It is from these stories that we get the iconic symbols of the medieval period---a knight in shining armor rescuing a damsel in distress from a dragon.
Medievalism became so popular that it influenced all sorts of things: The illustrations of William Blake, Sir Walter Scott's Waverly novels, Tennyson's poetry, the Pre-Raphaelite Brotherhood, Gothic Revival architecture, Wagner's operas. Medieval national epics like Beowulf and Nibelungenlied were translated into modern languages, widely read, and given scholarly examination, which later led to European monarchs using pseudo-medieval images for propagandic purposes.
All of this fascination with the medieval period rolled over into the early 20th century into the new medium of film. Many early narrative films were set in the middle ages and told the stories of famous people or characters like Joan of Arc, Robin Hood, William Wallace and more. A lot of the stereotypical images we have in our heads come from films, which were often based on Victorian depictions of the middle ages.
I'm curious as to what the link you see between D&D, Game of Thrones, and King Arthur is - to my mind, they are very different!
D&D is a mish-mash of 20th Century swords-and-sandals pulp, Tolkien, erroneous Victorian-era concepts of weapons and armour set in a dangerous world chock-full of fantastic monsters, with Jack Vance's magic thrown in. Magic is everywhere, the superhuman is normal.
Game of Thrones is a political and character drama based on Europe in the 14th-15th century, drawing a lot of inspiration from the Wars of the Roses. Magic is rare to non-existent, the most powerful men are still mere men. Martin has done extensive research on the period to inform his world, so I would argue that his world owes most to European history, and less to literary fantasy antecedents.
King Arthur lies somewhere between the two, with subtle magic common, but flashy D&D-style magic non-existent. Our modern understanding of King Arthur comes mostly from works based on Le Morte D'Arthur by Malory (which was itself a compilation and elaboration of existing English and French stories).
I know it's important to show people that living in that era would NOT have been fun
People didn't have iPods, but it was hardly a world of universal and abject misery, as is often presented. The Medieval era includes a vast span of time, and things changed significantly throughout.
For instance, in England, in the aftermath of the Black Death, came an era of plenty amidst an acute labour shortage, that saw an increase in standard of living, and the beginning of the end of the feudal system. Estimates of per-capita caloric production in England went from barely sufficient in the early 1300s to large surpluses in the late 1300s.
That same period that was good for common people and workers was much less good for lords, as they lacked the plentiful cheap labour they needed to work their demesnes.
So it's very important to nail down when, where, and who you're talking about when you say things like that.