No human perfectly reproduces the learning material they used.
If that was true, one might as well just higher engineers from Twitter and make a new platform from the code they remember!
Well, we humans do it occasionally. You probably remember a few specific code snippets in your lang of choice because they kept annoying you/you love them/you wrote them a lot. So if I would put you in the exactly right situation, you would indeed reproduce code verbatim.
So does Copilot.
I am not trying to insinuate that Copilot works like a human, but it is literally the same situation.