When writing materials like parchment were scarce and expensive, you didn’t throw them out because they had been used. Instead, you washed them with a dilute alkaline solution to weaken the hold of the ink on the paper, rubbed them down with pumice stone to clean them, and used them again (medieval monkish writing rooms sometimes had people who specialised in doing this). The result was a palimsest.
This meaning is explicit in the original Greek word palimpsestos, which is a compound of palin, “again” and psestos, “rubbed smooth”. Often the erasing wasn’t altogether successful and the original writing showed through. This is why the word also has the meaning of something that has been changed but which still shows traces of its earlier form, perhaps a building which has been altered but whose original structure is still recognisable.
In modern times, historically important documents have been recovered from the half-obliterated writing in palimpsests. David Carvalho wrote in Forty Centuries of Ink: “Manuscripts of the Gospels, of the Iliad, and of works of the highest merit, often of great beauty and accuracy, are dimly seen underneath stupid sermons, and theological writings of a nature so paltry that no man living cares to read them”. A palimpsest was found in Constantinople in 1906, which contained underneath a collection of prayers the complete Greek text of several of Archimedes’ most famous mathematical writings, one of them previously believed lost.