German copyright law distinguishes adaption/modification (Bearbeitung, §23 UrhG) and free use (Freie Benutzung, §24 UrhG) when using older works.
A Bearbeitung means that you edit an existing work. The character of the original work is still plainly visible. You hold copyright to your changes, but you need permission from the original copyright holder to publish your modified version. Open-source licenses give such permission, under some conditions.
A Freie Benutzung means that you create a new work that borrows some characteristics from an older work, but that the character of the new work is independent from the older work. As a work that was created in freier Benutzung is not a Bearbeitung it is a completely separate work and does not need permission from the older work's copyright holder.
Importantly, the concept of freie Benutzung is the legal basis of parodies and other transformative use cases (compare some aspects of fair use in the U.S.).
The distinction between these two cases is tricky and is decided on a case by case basis. In some cases, a freie Benutzung can even involve verbatim copies of snippets of an older work. What matters is that a freie Benutzung involves an inner distance or critical engagement by the creator with the older work, and that the characteristics of the older work fade away.
In the context of open source development, most modifications of existing open source software will be a Bearbeitung. There is no percentage of changes where the original copyright would disappear. I believe that even 100% changes are not sufficient if the character of the original is still clearly visible. E.g. a complete refactoring and reformatting of a project's source code is most likely a Bearbeitung.
In contrast, I would argue that one of my current projects is a Freie Benutzung: I created an independent project that used some library. I inlined some parts of the library and adapted them to my use case, and over time removed irrelevant functionality. The borrowed code is now structured completely differently, all it has in common with the library is the general problem space and a few variable names. I think my critical examination of the older work satisfies the necessary inner distance, and that the character of the work has changed substantially.