I was researching the plays of Plautus and noticed only 20 out of 130 plays have survived. I was wondering what are the odds of us stumbling upon a copy or sizable fragment of a supposedly lost piece of Roman literature. I imagine an old scroll being found in an ancient library, but the only info I could find was a story about how they found part of a legal code in a medieval book binding
A collection of St. Augustine's sermons were rediscovered in a library a few decades ago, so it does happen. But at this point, most of the collections have been pretty thoroughly scoured, and finding a missing text takes a lot of work. Typically, scholars only realize they have something new after extensive research.
But there are a few ways new texts are still being found.
We continue to recover papyrus fragments from archaeological sites with good preservation (Egypt mostly), but these are usually only scraps, not complete documents. They're useful, but rarely enough to piece together a missing text. Some of these fragments come from book bindings, where they were recycled. Menander's plays were discovered recycled for paper mache in a mummy case in the early 20th century. These sorts of discoveries are not uncommon, but they're usually not nearly as exciting as something like the dead sea scrolls where you have complete texts instead of fragments.
We also have texts that are damaged and difficult to read, and various types of imaging technology are being used to try to recover their contents. We have a lot of books from Herculaneum, but the volcanic eruption that destroyed the city made them impossible to unroll. There have been some exciting experiments with new 3D xray technology to try to recover their contents, which may yet produce results.
And archaeologists find inscriptions at excavation sites. These aren't going to give you a new play, but they do tell something about the local community (they're usually dedications, prayers, or curse tablets).
I wouldn't hold my breath for the rediscovery of a lost Plautus, however. It could happen, but is unlikely at this point. People have been combing libraries for these texts since the 15th century, even going to far as to reconstruct missing authors from their quotations included in other ancient texts. There's more work to be done, but it's mostly very specialized and focused on carefully refining what we have available.
The focus of most archaeology has now shifted from trying to dig up texts to interpreting the non-textual material that's much (much) more common in ways that add to our knowledge by telling us things that aren't recorded in textual sources (like what people did in their day to day lives).
It is possible, but the odds are small. The reason so much was lost to begin with is because 'paper' (what exactly was used varies) degrades relatively quickly. To preserve a written text required consistent constant copying of the text (by hand) across the millenia. Which only happened if there was a real demand for the text, or if by chance a text kept finding an interested patron keeping it around.
This is why the new testament is actually some of the best preserved ancient texts we have, because it was relatively quickly (after a century or two) copied on a massive scale we have tons of surviving copies compared to other ancient texts which many survive in only a handful of manuscripts. (Though ofc this doesn't mean you need to believe what is written any more than you need to believe what is written in Homer, I'm just talking from a "we know this is the text ancient people wrote and read and copied".)
When we recover a 'lost' text, it's because it was preserved under unusual circumstances. Such as the Dead Sea Scrolls, or the various instances of texts found buried in the Egyptian desert.
Another notable and relevant example is the Villa of the Papyri in Herculaneum. Herculaneum was a sister town to Pompei that was buried by the same volcanic eruption, and in this specific villa they found scrolls. Afaik not everything has been excavated yet, so I personally am hoping someday they'll find a treasure trove of lost literature. (Though from what I understand, so far they've only found pages and pages of obscure Greek philosophy.)
It happens from time to time. In addition to /u/NFB42's comments, I want to mention one more method for survival. Cicero's De Re Publica exists only in palimpsest, which is a manuscript that was erased and written over (with Augustine of all things in this case!) and was only detected in the early 1800s.