This is the problem, there is no easy analogy. If I’ve learned how to code from an open source course, I don’t breach copyright every time I write code in my career. If I clone the course, just replacing some of the examples and using synonyms then I probably have. ChatGPT is somewhere between these extremes and it’s unclear what the principle should be.
Perhaps it’s like learning to play guitar by watching other guitarists, then releasing songs in the same genre.