Of all the 123 plays of Sophocles, why is that 7 only survived?
The survival of Greek tragedy was precarious. It relied on fragile physical texts being copied and recopied by generations of scribes. Often only the most popular or influential texts were recopied. A book might cost the equivalent of several weeks`salary for a laborer, and so people owned few books. Since all books were copied by hand, there weren`t massive numbers of copies of the same book in bookstores. Instead, if you wanted a book, you would normally go to a book dealer who had a copy of the text, and order a copy made for you, a process that would take several weeks, and was quite expensive. This means that unless a book was used as a school text, important to a philosophical, medical or other school or profession, or very important in some other way, it wouldn`t get copied.
For Sophocles, his plays were lost in several stages. First, those plays which did not win prizes at festivals were unlikely to be copied.
Next, a major stage in preservation was the establishment of the canon of Attic authors by the librarians and scholars of Alexandria. This included a selection of plays by 3 tragic playwrights (Aeschylus, Sophocles, Euripides). Anything not in this canon (a sort of list of important books`) was unlikely to be preserved. After the fall of the western Roman empire, classical works were recopied in Byzantium and Christian monasteries -- but many were not recopied.