My understanding is that it’s similar to any other form of derivation and even accusations of plagiarism in music, i.e. there’s a big grey area running a spectrum from “copying” to “new work”, for which the ruling of each individual case ultimately depends a lot on the personal opinions of a judge, and takes into account multiple factors including intent and dilution.