Sumerian died as a spoken language somewhere around the beginning of the second millennium BCE, replaced by Akkadian, and then continued in use for another two thousand years as a language of religion and learning.
Scribes trained in Akkadian-speaking Babylonia and Assyria learned Sumerian from grammatical exercises, sign lists and bilingual texts, and copied the old compositions for centuries after nobody spoke them. Rituals kept Sumerian formulas; incantations were written in Sumerian with an Akkadian translation running line by line beside them; temple laments were still being performed by specialist priests in the Hellenistic period. The relationship is roughly that of Latin to medieval Europe, sustained for longer.
That habit is why the material survives at all, and it is also why it survives in the form it does. Most Sumerian literature is known from copies made by student scribes in Babylonian schools around 1800 BCE, several centuries after composition, and the school curriculum determined what got copied. Compositions that fell out of the syllabus are lost.
The modern recovery has been correspondingly institutional. The Electronic Text Corpus of Sumerian Literature assembled composite texts and translations of several hundred compositions and made them freely available, which transformed access to a literature previously scattered across specialist publications, and the volume of untranslated tablets in museum collections remains large.