Has it always been a frequent subject of discussion by philosophers/artists ever since Plato's time? Was it always given as much importance as it is now?
If not, who 'rediscovered' it and brought it back into public attention; when, and why?
So, as a preamble, in Plato's Republic, he has Socrates say:
Imagine this: People live under the earth in a cave-like dwelling. Stretching a long way up toward the daylight is its entrance, toward which the entire cave is gathered. The people have been in this dwelling since childhood, shackled by the legs and neck. Thus they stay in the same place so that there is only one thing for them to look that: whatever they encounter in front of their faces. But because they are shackled, they are unable to turn their heads around.
Some light, of course, is allowed them, namely from a fire that casts its glow toward them from behind them, being above and at some distance. Between the fire and those who are shackled there runs a walkway at a certain height. Imagine that a low wall has been built the length of the walkway, like the low curtain that puppeteers put up, over which they show their puppets.
...from the beginning people like this have never managed, whether on their own or with the help by others, to see anything besides the shadows that are projected on the wall opposite them by the glow of the fire.
Whenever any of them was unchained and was forced to stand up suddenly, to turn around, to walk, and to look up toward the light, in each case the person would be able to do this only with pain and because of the flickering brightness would be unable to look at those things whose shadows he previously saw.
This is the Allegory of the Cave (AotC): the shadows on the walls are reality as it appears to us, and the light is the world of thought, which Plato sees as more real than reality.
So, did the AotC get forgotten about after the classical Greek period? It depends.
Firstly, Plato's influence is all over medieval Europe. St. Augustine, perhaps the most influential Christian philosopher in the Medieval era, was deeply influenced by what are now called Neoplatonist ideas (Neoplatonists at the time simply called themselves Platonists, after Plato, but their thought was more complex than simply following Plato). And because the Medieval era is profoundly Christian, this means that Neoplatonism was very influential.
The foundation of Neoplatonist thought was that, to quote the SEP:
mindful consciousness (nous, often translated as thought, intelligence, or intellect) is in an important sense ontologically prior to the physical realm typically taken for ultimate reality (Mind over Matter).
In other words, the light outside is more real than what's in the cave.
However, Plato's influence on the medieval period, while enormous, was indirect. The majority of his works, including The Republic (the text the allegory is in), were unavailable in the Latin-speaking/writing world in the Medieval period. Instead, his works only became available to Western Europe when they were translated from Greek (by Marsilio Ficino) after the fall of Constantinople in 1453 - stuff like The Republic becoming available in the West pretty much marks the boundary between the late Medieval period and the Renaissance.
The Neoplatonist works that did circulate in the Medieval period are clearly influenced by Plato's conceptions of reality, and for all the world sound like they're written by people who understand what the allegory's about. However, as far as I can tell, surviving Neoplatonist(-influenced) works in the Medieval era don't specifically mention that particular allegory. (As an aside, the Islamic Golden Age philosopher Ibn Rushd/Averroes wrote a commentary on Plato's The Republic which faithfully summarises the Allegory, but Ibn Rushd's commentary on the AotC was not available in the West until the 16th century, after the original had been translated into Hebrew and then Latin.)
However, by the 20th century, the Allegory of the Cave is very-well known in the West. Bertrand Russell's 1945 History Of Western Philosophy refers to the AotC as 'famous', even. Amusingly, in researching this, I found a paper by John Henry Wright from 1906 in Harvard Studies In Classical Philology devoted to trying to figure out which particular Greek cave Plato is discussing (and Wright very clearly assumes that everyone knows what Plato's cave is all about). So at what point in between Ficino and Bertrand Russell did the Allegory become famous?
The answer almost certainly has to do with Rene Descartes. There's a view present in Bertrand Russell's history book, for example, that modern philosophy began with Descartes; it's a very commonplace argument that Descartes' 'Way Of Ideas' set up the framework of the questions about reality that subsequent Western philosophers reacted against, from Locke to Hume to Kant (and I should point out that 'I think therefore I am' - an encapsulation of the Way Of Ideas - is probably even more famous than the Cave).
Descartes was also heavily indebted to Plato. Stephen Buckle argues that Descartes' 1641 Meditations On First Philosophy are in fact 'a rewriting of the Platonic allegory of the cave for modern times'. Descartes' influence and his debt to Plato therefore creates room for the Allegory of the Cave to not only simply be a part of philosophical history, but also for the Allegory to be told as a way of explaining Plato's influence on the modern Western philosophy tradition that's indebted to Descartes.
Descartes' debt to Plato was certainly noted by philosophers contemporaneous to Descartes; Buckle quotes Thomas Hobbes as saying "I am sorry that so excellent an author of new speculations should publish this old stuff" [i.e., stuff that rips off Plato], and Descartes replying to Hobbes that he is a 'petty-minded critic' and that he "wanted to prepare readers' minds for the study of the things which are related to the intellect, and help them to distinguish these things from corporeal things".
The earliest reference to the AotC in English that I can find is in Thomas Stanley's 1656 The History Of Philosophy, In Eight Parts where Stanley discusses how:
Foolish men are like those who lead all their life in some Cave underground, where they never saw the light of the Sun, but only some empty thin shadows of such bodies as are with us uopn the Earth, which seeing, they think they see true bodies. As these, if ever they should be brought out of darknesse into the clear light, would questionlesse despise all things which they saw before, and themselves much more, as having been absolutely deceived; so they who rise up out of the darknesse of this life to those things which are divine and fair, in all likelyhood will contemn what before they most esteemed, and love more vehemently this contemplation.
So between Stanley in 1656, and Hobbes' roughly contemporaneous reply to Descartes, the Allegory Of The Cave was certainly known about in English circles (though The Republic wasn't translated into English until the mid-18th century; educated men of the time read Latin). However, it doesn't seem to have been especially prominent in writing about Plato. I can't specifically prove it, but I suspect that Johann Jakob Brucker's influential Critical History of Philosophy, completed in 1744, likely played a role in specifically drawing attention to the Allegory of The Cave within Plato. Brucker says (translated by Enfield) that:
His conceptions on [Ideas as the only permanent substances] are beautifully expressed in a passage of his Republic in which he compares the state of the human mind with respect to the material and the intellectual world, to that of a man, who, in a cave into no light can enter but by a single passage, views, upon a wall opposite to the entrance, the shadows of external objects, and mistakes them for realities. So strongly was the imagination of Plato impressed with this conception, that, in the election of magistrates for his republic, he required that no one should be chosen, who had not, by the habitual contemplation of the world of Ideas, attained a perfect power of abstraction.
Brucker's history of philosophy was influential on Denis Diderot, one of the key figures of the Enlightenment, and one of the authors of the 1751 Encyclopedie; Diderot's articles on philosophers in the Encyclopedie often depend on Brucker. Outside of the Encyclopedie, there's a section of Diderot's Salons, for instance, where Diderot describes a dream of being in 'the cave of the philosopher'. Given the prominence of Diderot and the Encyclopedie (and given the Enlightment's debt to Descartes), I'd guess that was ground zero for the AotC becoming so popular. At least, the mid-18th century seems to be the point at which terms like 'Plato's Cave' start ticking up on Google nGrams.
And ultimately it's stayed popular because it serves several purposes for the average Philosophy 101 class. It encapsulates the part of Plato preserved in Neoplatonism, and it links ancient to modern philosophy via Descartes. It's vivid! And most importantly, it makes a pretty good intro to what philosophy is fundamentally about: that understanding can be found by examining ideas, instead of just assuming that our perception of the world we grew up with is the way things must be.
Sources:
'Descartes, Plato and the Cave' by Stephen Buckle (2007) in Philosophy.
Inner Grace: Augustine In The Traditions Of Plato And Paul by Philip Cary
'The Origins Of Plato's Cave' by John Henry Wright (1906) in Harvard Studies in Classical Philology
A History Of Western Philosophy: And Its Connection With Political And Social Circumstances From The Earliest Times To The Present Day by Bertrand Russell.
'Shadows On The Wall Of Reason: Diderot Before Fragonard' by David Ferris (in Brodsky & LaBrada edited book Inventing Agency: Essays On The Literary And Philosophical Production Of The Modern Subject).
'History Of The History Of Philosophy' by H. S. Harris (1990), in Journal Of The History Of Ideas